/[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.5 by vip-ire, Thu Nov 4 15:50:00 2010 UTC
# Line 1  Line 1 
1  diff -up e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete.better-ldap e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete  diff -Nur -x '*.orig' -x '*.rej' e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete mezzanine_patched_e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete
2  --- e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete.better-ldap 2010-11-02 13:37:55.000000000 -0600  --- e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete     2010-11-04 16:43:36.000000000 +0100
3  +++ e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete     2010-11-02 13:38:04.000000000 -0600  +++ mezzanine_patched_e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-delete   2010-11-04 16:42:13.000000000 +0100
4  @@ -25,6 +25,7 @@  @@ -25,6 +25,7 @@
5    
6   event=$1   event=$1
# 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 -Nur -x '*.orig' -x '*.rej' e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify mezzanine_patched_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     2010-11-04 16:43:36.000000000 +0100
34  +++ e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify     2010-11-02 13:38:56.000000000 -0600  +++ mezzanine_patched_e-smith-ibays-2.2.0/root/etc/e-smith/events/actions/ibay-modify   2010-11-04 16:43:26.000000000 +0100
35  @@ -32,6 +32,7 @@ my $conf = esmith::ConfigDB->open_ro  @@ -32,6 +32,7 @@
36       or die "Could not open Config DB";       or die "Could not open Config DB";
37    
38   my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';   my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
# Line 41  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 40  diff -up e-smith-ibays-2.2.0/root/etc/e-
40    
41   $ENV{'PATH'} = "/bin";   $ENV{'PATH'} = "/bin";
42    
43  @@ -55,41 +56,14 @@ if ($event eq 'ibay-create')  @@ -55,41 +56,14 @@
44    
45       # Create the ibay's unique group first       # Create the ibay's unique group first
46    
# Line 85  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 84  diff -up e-smith-ibays-2.2.0/root/etc/e-
84    
85           system(           system(
86               "/usr/sbin/useradd",               "/usr/sbin/useradd",
87  @@ -108,16 +82,41 @@ if ($event eq 'ibay-create')  @@ -108,16 +82,42 @@
88               "-s",               "-s",
89               "/bin/false",               "/bin/false",
90               "$ibayName"               "$ibayName"
91  -        ) == 0 or die "Failed to create account $ibayName.\n";  -        ) == 0 or die "Failed to create account $ibayName.\n";
92  +        ) == 0 or ( $x = 255, warn "Failed to create (unix) account $ibayName.\n";  +        ) == 0 or ( $x = 255, warn "Failed to create (unix) account $ibayName.\n" );
93       }       }
94    
95  +    system(  +    system(
# 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",
104    +        "-C/etc/cpu-system.conf",
105  +        "-u",  +        "-u",
106  +        $ibay->prop("Uid"),  +        $ibay->prop("Uid"),
107  +        "-g",  +        "-g",
# Line 116  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 116  diff -up e-smith-ibays-2.2.0/root/etc/e-
116  +        "-s",  +        "-s",
117  +        "/bin/false",  +        "/bin/false",
118  +        "$ibayName"  +        "$ibayName"
119  +    ) == 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" );
120  +  +
121       #------------------------------------------------------------       #------------------------------------------------------------
122       # Create the ibay files and set the password.       # Create the ibay files and set the password.
# Line 129  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 129  diff -up e-smith-ibays-2.2.0/root/etc/e-
129    
130       processTemplate( {       processTemplate( {
131          TEMPLATE_PATH=>"/home/e-smith/files/ibays/html/index.html",          TEMPLATE_PATH=>"/home/e-smith/files/ibays/html/index.html",
132  @@ -125,16 +124,14 @@ if ($event eq 'ibay-create')  @@ -125,16 +125,14 @@
133          MORE_DATA=>{IBAY_NAME=>$ibayName},          MORE_DATA=>{IBAY_NAME=>$ibayName},
134                  } );                  } );
135    
# Line 147  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 147  diff -up e-smith-ibays-2.2.0/root/etc/e-
147       }       }
148  +  +
149  +    system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0  +    system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0
150  +        or ( $x = 255, warn "Error locking (ldap) account $ibayName" );  +        or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Error locking (ldap) account $ibayName" );
151   }   }
152   elsif ($event eq 'ibay-modify')   elsif ($event eq 'ibay-modify')
153   {   {
154  @@ -142,19 +139,16 @@ elsif ($event eq 'ibay-modify')  @@ -142,19 +140,16 @@
155       # Modify ibay description in /etc/passwd using "usermod"       # Modify ibay description in /etc/passwd using "usermod"
156       #------------------------------------------------------------       #------------------------------------------------------------
157    
# Line 172  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 172  diff -up e-smith-ibays-2.2.0/root/etc/e-
172    
173  +    system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"),  +    system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"),
174  +    "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0  +    "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0
175  +        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" );
176   }   }
177    
178   #------------------------------------------------------------   #------------------------------------------------------------
179  @@ -166,7 +160,7 @@ elsif ($event eq 'ibay-modify')  @@ -166,7 +161,7 @@
180   #--------------------------------------------------   #--------------------------------------------------
181    
182   chdir "/home/e-smith/files/ibays/$ibayName"   chdir "/home/e-smith/files/ibays/$ibayName"
# Line 185  diff -up e-smith-ibays-2.2.0/root/etc/e- Line 185  diff -up e-smith-ibays-2.2.0/root/etc/e-
185    
186   mkdir '.AppleDesktop' unless (-d '.AppleDesktop');   mkdir '.AppleDesktop' unless (-d '.AppleDesktop');
187    
188  @@ -237,3 +231,5 @@ sub process  @@ -237,3 +232,5 @@
189   }   }
190    
191   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