/[smeserver]/rpms/e-smith-ibays/sme8/e-smith-ibays-2.2.0-better-ldap.patch
ViewVC logotype

Diff of /rpms/e-smith-ibays/sme8/e-smith-ibays-2.2.0-better-ldap.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by slords, Tue Nov 2 19:49:11 2010 UTC Revision 1.2 by slords, Wed Nov 3 14:00:52 2010 UTC
# Line 9  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 9  diff -up e-smith-ibays-2.2.0/root/etc/e-
9   if [ -z "$ibay" ]   if [ -z "$ibay" ]
10   then   then
11       echo ibayName argument missing       echo ibayName argument missing
12  @@ -32,12 +33,15 @@ then  @@ -32,12 +33,17 @@
13   fi   fi
14    
15   ldapauth=$(/sbin/e-smith/config getprop ldap Authentication || echo disabled)   ldapauth=$(/sbin/e-smith/config getprop ldap Authentication || echo disabled)
# Line 19  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 19  diff -up e-smith-ibays-2.2.0/root/etc/e-
19  -if [ "$ldapauth" == "enabled" ]  -if [ "$ldapauth" == "enabled" ]
20  +if [ "$ldapauth" != "enabled" ]  +if [ "$ldapauth" != "enabled" ]
21   then   then
 -    /usr/sbin/cpu userdel "$ibay"  
 -    /usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay"  
 -else  
 -    exec /usr/sbin/userdel "$ibay"  
22  +    /usr/sbin/userdel "$ibay" || x=1  +    /usr/sbin/userdel "$ibay" || x=1
23         /usr/sbin/cpu userdel "$ibay"
24         /usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay"
25     else
26    -    exec /usr/sbin/userdel "$ibay"
27    +    /usr/sbin/cpu userdel "$ibay" || x=1
28    +    /usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay" || x=1
29   fi   fi
30  +  +
 +/usr/sbin/cpu userdel "$ibay" || x=1  
 +/usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay" || x=1  
 +  
31  +exit $x  +exit $x
32  diff -up e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify.better-ldap e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify  diff -up e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify.better-ldap e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify
33  --- e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify.better-ldap 2010-11-02 13:37:55.000000000 -0600  --- e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify.better-ldap 2010-11-02 13:37:55.000000000 -0600
# Line 98  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 97  diff -up e-smith-ibays-2.2.0/root/etc/e-
97  +        "-g",  +        "-g",
98  +        $ibay->prop("Gid"),  +        $ibay->prop("Gid"),
99  +        $ibayName  +        $ibayName
100  +    ) == 0 or ( $x = 255, warn "Failed to create (ldap) group $ibayName.\n" );  +    ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) group $ibayName.\n" );
101  +  +
102  +    system(  +    system(
103  +        "/usr/sbin/cpu", "useradd",  +        "/usr/sbin/cpu", "useradd",
# Line 116  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 115  diff -up e-smith-ibays-2.2.0/root/etc/e-
115  +        "-s",  +        "-s",
116  +        "/bin/false",  +        "/bin/false",
117  +        "$ibayName"  +        "$ibayName"
118  +    ) == 0 or ( $x = 255, warn "Failed to create (ldap) account $ibayName.\n" );  +    ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" );
119  +  +
120       #------------------------------------------------------------       #------------------------------------------------------------
121       # Create the ibay files and set the password.       # Create the ibay files and set the password.
# Line 147  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 146  diff -up e-smith-ibays-2.2.0/root/etc/e-
146       }       }
147  +  +
148  +    system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0  +    system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0
149  +        or ( $x = 255, warn "Error locking (ldap) account $ibayName" );  +        or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Error locking (ldap) account $ibayName" );
150   }   }
151   elsif ($event eq 'ibay-modify')   elsif ($event eq 'ibay-modify')
152   {   {
# Line 172  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 171  diff -up e-smith-ibays-2.2.0/root/etc/e-
171    
172  +    system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"),  +    system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"),
173  +    "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0  +    "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0
174  +        or ( $x = 255, warn "Failed to modify (ldap) account $ibayName.\n" );  +        or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify (ldap) account $ibayName.\n" );
175   }   }
176    
177   #------------------------------------------------------------   #------------------------------------------------------------


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed