/[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.5 by vip-ire, Thu Nov 4 15:50:00 2010 UTC Revision 1.6 by slords, Thu Nov 4 15:59:37 2010 UTC
# Line 20  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 20  diff -Nur -x '*.orig' -x '*.rej' e-smith
20  +if [ "$ldapauth" != "enabled" ]  +if [ "$ldapauth" != "enabled" ]
21   then   then
22  +    /usr/sbin/userdel "$ibay" || x=1  +    /usr/sbin/userdel "$ibay" || x=1
23       /usr/sbin/cpu userdel "$ibay"       /usr/sbin/cpu -C/etc/cpu-system.conf userdel "$ibay"
24       /usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay"       /usr/sbin/cpu -C/etc/cpu-system.conf groupdel "$ibay"
25   else   else
26  -    exec /usr/sbin/userdel "$ibay"  -    exec /usr/sbin/userdel "$ibay"
# Line 84  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 84  diff -Nur -x '*.orig' -x '*.rej' e-smith
84    
85           system(           system(
86               "/usr/sbin/useradd",               "/usr/sbin/useradd",
87  @@ -108,16 +82,42 @@  @@ -108,16 +82,41 @@
88               "-s",               "-s",
89               "/bin/false",               "/bin/false",
90               "$ibayName"               "$ibayName"
# Line 100  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 100  diff -Nur -x '*.orig' -x '*.rej' e-smith
100  +    ) == 0 or ( $x = $ldapauth ne 'enabled' ? $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", "-C/etc/cpu-system.conf", "useradd",
 +        "-C/etc/cpu-system.conf",  
104  +        "-u",  +        "-u",
105  +        $ibay->prop("Uid"),  +        $ibay->prop("Uid"),
106  +        "-g",  +        "-g",
# Line 129  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 128  diff -Nur -x '*.orig' -x '*.rej' e-smith
128    
129       processTemplate( {       processTemplate( {
130          TEMPLATE_PATH=>"/home/e-smith/files/ibays/html/index.html",          TEMPLATE_PATH=>"/home/e-smith/files/ibays/html/index.html",
131  @@ -125,16 +125,14 @@  @@ -125,16 +124,14 @@
132          MORE_DATA=>{IBAY_NAME=>$ibayName},          MORE_DATA=>{IBAY_NAME=>$ibayName},
133                  } );                  } );
134    
# Line 146  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 145  diff -Nur -x '*.orig' -x '*.rej' e-smith
145  +            or ( $x = 255, warn "Error locking (unix) account $ibayName" );  +            or ( $x = 255, warn "Error locking (unix) account $ibayName" );
146       }       }
147  +  +
148  +    system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0  +    system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-L", $ibayName) == 0
149  +        or ( $x = $ldapauth ne 'enabled' ? $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   {   {
153  @@ -142,19 +140,16 @@  @@ -142,19 +139,16 @@
154       # Modify ibay description in /etc/passwd using "usermod"       # Modify ibay description in /etc/passwd using "usermod"
155       #------------------------------------------------------------       #------------------------------------------------------------
156    
# Line 170  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 169  diff -Nur -x '*.orig' -x '*.rej' e-smith
169  +            or ( $x = 255, warn "Failed to modify (unix) account $ibayName.\n" );  +            or ( $x = 255, warn "Failed to modify (unix) account $ibayName.\n" );
170       }       }
171    
172  +    system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"),  +    system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-c", $ibay->prop("Name"),
173  +    "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0  +    "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0
174  +        or ( $x = $ldapauth ne 'enabled' ? $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   #------------------------------------------------------------   #------------------------------------------------------------
178  @@ -166,7 +161,7 @@  @@ -166,7 +160,7 @@
179   #--------------------------------------------------   #--------------------------------------------------
180    
181   chdir "/home/e-smith/files/ibays/$ibayName"   chdir "/home/e-smith/files/ibays/$ibayName"
# Line 185  diff -Nur -x '*.orig' -x '*.rej' e-smith Line 184  diff -Nur -x '*.orig' -x '*.rej' e-smith
184    
185   mkdir '.AppleDesktop' unless (-d '.AppleDesktop');   mkdir '.AppleDesktop' unless (-d '.AppleDesktop');
186    
187  @@ -237,3 +232,5 @@  @@ -237,3 +231,5 @@
188   }   }
189    
190   find(\&process,  glob("* .AppleDesktop"));   find(\&process,  glob("* .AppleDesktop"));


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