[Devel] Patch for openserctl

Matty matty91 at gmail.com
Mon Jul 3 04:10:33 CEST 2006


When I run openserctl on a Solaris 10 host, I keep getting the following 
error when attempting to add a user:

$ openserctl add matty at shibby.net foo matty91 at gmail.com
awk: syntax error near line 1
awk: bailing out near line 1
awk: syntax error near line 1
awk: bailing out near line 1
HA1 calculation failed

After enabling verbose output, it looks like two awk statements 
add spaces between the "-F" option and the delimiter:

$ openserctl add matty at shibby.net foo matty91 at gmail.com

[ ..... ]

echo $1|awk -F @ '{print $1}'
++ echo matty at matty.com
++ awk -F @ '{print $1}'
awk: syntax error near line 1
awk: bailing out near line 1
+ SERUSER=
echo $1|awk -F @ '{print $2}'
++ echo matty at matty.com
++ awk -F @ '{print $2}'
awk: syntax error near line 1
awk: bailing out near line 1

Would it be possible to remove the spaces? I attached a patch that removes 
the spaces, and gawk, nawk and awk seem to be ok with it.

Thanks,
- Ryan
--
UNIX Administrator
http://daemons.net/~matty


[1] Patch to openserctl

--- openserctl.new       Sun Jul  2 22:03:41 2006
+++ openserctl  Sun Jul  2 22:03:53 2006
@@ -410,8 +410,8 @@
  # calculate name and domain of current user
  set_user() {

-       SERUSER=`echo $1|awk -F @ '{print $1}'`
-       SERDOMAIN=`echo $1|awk -F @ '{print $2}'`
+       SERUSER=`echo $1|awk -F@ '{print $1}'`
+       SERDOMAIN=`echo $1|awk -F@ '{print $2}'`

         if [ -z "$SERDOMAIN" ] ; then
                 SERDOMAIN="$SIP_DOMAIN"



More information about the Devel mailing list