[csw-devel] SF.net SVN: gar:[9825] csw/mgar/pkg/cswclassutils/trunk/files/ CSWcswclassutils.i.cswusergroup

skayser at users.sourceforge.net skayser at users.sourceforge.net
Thu May 6 19:01:49 CEST 2010


Revision: 9825
          http://gar.svn.sourceforge.net/gar/?rev=9825&view=rev
Author:   skayser
Date:     2010-05-06 17:01:49 +0000 (Thu, 06 May 2010)

Log Message:
-----------
cswclassutils: fixed exclamation mark bashism and argument passing for set_user_nologin

Modified Paths:
--------------
    csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup

Modified: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup	2010-05-06 07:58:30 UTC (rev 9824)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup	2010-05-06 17:01:49 UTC (rev 9825)
@@ -170,6 +170,7 @@
   dir="$4"
   shell="$5"
   create="$6" 
+  nopass="$7"
 
   if getent passwd $user > /dev/null; then
     echo User $user already exists
@@ -194,9 +195,12 @@
   else
     exit_error "Failed to add user $user"
   fi
+  [ -n "$nopass" ] && set_user_nologin "$user"
 }
 
 set_user_nologin() {
+  user="$1"
+
   case "`uname -r`" in
   5.8|5.9)
     # for old solaris, we munge the shadow file manually.
@@ -221,7 +225,8 @@
   ;;
   *)
     # for modern solaris, use the built-in tools
-    if ! passwd -N $user; then
+    passwd -N $user
+    if [ $? -ne 0 ]; then
       exit_error "Setting NP for '$user' failed."
     fi
   ;;
@@ -256,8 +261,8 @@
     fi
 
     if [ -n "$user" ]; then
-      create_user "$user" "$group" "$gcos" "$dir" "$shell" "$create"
-      [ -n "$nopass" ] && set_user_nologin "$user"
+      create_user \
+        "$user" "$group" "$gcos" "$dir" "$shell" "$create" "$nopass"
     else
       echo No user to create
     fi


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list