/[smeserver]/rpms/e-smith-base/sme8/e-smith-base-5.2.0-better-ldap.patch
ViewVC logotype

Diff of /rpms/e-smith-base/sme8/e-smith-base-5.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:03 2010 UTC Revision 1.2 by slords, Wed Nov 3 14:00:42 2010 UTC
# Line 61  diff -up e-smith-base-5.2.0/root/etc/e-s Line 61  diff -up e-smith-base-5.2.0/root/etc/e-s
61  +        "/usr/sbin/cpu", "groupadd",  +        "/usr/sbin/cpu", "groupadd",
62  +        "-g", $gid,  +        "-g", $gid,
63  +        $groupName  +        $groupName
64  +    ) == 0 or ( $x = 255, warn "Failed to create (ldap) group $groupName.\n" );  +    ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) group $groupName.\n" );
65  +  +
66  +# Now create the dummy user account (in ldap)  +# Now create the dummy user account (in ldap)
67  +system(  +system(
# Line 74  diff -up e-smith-base-5.2.0/root/etc/e-s Line 74  diff -up e-smith-base-5.2.0/root/etc/e-s
74  +        "-s",  +        "-s",
75  +        "/bin/false",  +        "/bin/false",
76  +        "$groupName"  +        "$groupName"
77  +    ) == 0 or ( $x = 255, warn "Failed to create (ldap) user $groupName.\n" );  +    ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) user $groupName.\n" );
78  +  +
79   # Release lock if we have one   # Release lock if we have one
80   $lock && esmith::lockfile::UnlockFile($lock);   $lock && esmith::lockfile::UnlockFile($lock);
# Line 111  diff -up e-smith-base-5.2.0/root/etc/e-s Line 111  diff -up e-smith-base-5.2.0/root/etc/e-s
111  +    $groups = join (',', sort (@groupList));  +    $groups = join (',', sort (@groupList));
112  +  +
113  +    system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-G", "$groups", "$member") == 0  +    system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-G", "$groups", "$member") == 0
114  +        or ( $x = 255, warn "Failed to modify supplementary (ldap) group list for $member.\n" );  +        or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify supplementary (ldap) group list for $member.\n" );
115   }   }
116    
117  -exit (0);  -exit (0);
# Line 150  diff -up e-smith-base-5.2.0/root/etc/e-s Line 150  diff -up e-smith-base-5.2.0/root/etc/e-s
150    
151  -exit (0);  -exit (0);
152  +system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "userdel", "$groupName") == 0  +system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "userdel", "$groupName") == 0
153  +    or ( $x = 255, warn "Failed to delete dummy user for (ldap) group $groupName.\n" );  +    or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to delete dummy user for (ldap) group $groupName.\n" );
154  +  +
155  +system("/usr/sbin/cpu", "groupdel", "$groupName") == 0  +system("/usr/sbin/cpu", "groupdel", "$groupName") == 0
156  +    or ( $x = 255, warn "Failed to delete (ldap) group $groupName.\n" );  +    or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to delete (ldap) group $groupName.\n" );
157  +  +
158  +exit ($x);  +exit ($x);
159  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix.better-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix.better-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix
# Line 185  diff -up e-smith-base-5.2.0/root/etc/e-s Line 185  diff -up e-smith-base-5.2.0/root/etc/e-s
185       }       }
186    
187  +    system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-c", "$groupDesc", "$groupName") == 0  +    system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-c", "$groupDesc", "$groupName") == 0
188  +        or ( $x = 255, warn "Failed to modify (ldap) group description for $groupName.\n" );  +        or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify (ldap) group description for $groupName.\n" );
189  +  +
190       my ($name, $passwd, $gid, $members) = getgrnam ($groupName);       my ($name, $passwd, $gid, $members) = getgrnam ($groupName);
191       my @oldMembers = split (/\s+/, $members);       my @oldMembers = split (/\s+/, $members);
# Line 225  diff -up e-smith-base-5.2.0/root/etc/e-s Line 225  diff -up e-smith-base-5.2.0/root/etc/e-s
225  +        $groups = join (',', sort (@groupList));  +        $groups = join (',', sort (@groupList));
226  +  +
227  +        system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-G", "$groups", "$member") == 0  +        system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-G", "$groups", "$member") == 0
228  +            or ( $x = 255, warn "Failed to modify supplementary (ldap) group list for $member.\n" );  +            or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify supplementary (ldap) group list for $member.\n" );
229       }       }
230   }   }
231    
# Line 301  diff -up e-smith-base-5.2.0/root/etc/e-s Line 301  diff -up e-smith-base-5.2.0/root/etc/e-s
301  +        "-g",  +        "-g",
302  +        $gid,  +        $gid,
303  +        $userName  +        $userName
304  +    ) == 0 or ( $x = 255, warn "Failed to create (ldap) group $userName.\n" );  +    ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) group $userName.\n" );
305  +  +
306  +# Now create the user account (in ldap)  +# Now create the user account (in ldap)
307  +system(  +system(
# Line 317  diff -up e-smith-base-5.2.0/root/etc/e-s Line 317  diff -up e-smith-base-5.2.0/root/etc/e-s
317  +        "-k/etc/e-smith/skel/user",  +        "-k/etc/e-smith/skel/user",
318  +        "-s", "$shell",  +        "-s", "$shell",
319  +        $userName  +        $userName
320  +    ) == 0 or ( $x = 255, warn "Failed to create (ldap) account $userName.\n" );  +    ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) account $userName.\n" );
321  +  +
322    
323   # Release lock if we have one   # Release lock if we have one
# Line 339  diff -up e-smith-base-5.2.0/root/etc/e-s Line 339  diff -up e-smith-base-5.2.0/root/etc/e-s
339  +        and ( $x = 255, warn "Could not lock (unix) password for $userName\n" );  +        and ( $x = 255, warn "Could not lock (unix) password for $userName\n" );
340   }   }
341  +system("/usr/sbin/cpu", "usermod", "-L", "$userName")  +system("/usr/sbin/cpu", "usermod", "-L", "$userName")
342  +    and ( $x = 255, warn "Could not lock (ldap) password for $userName\n" );  +    and ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Could not lock (ldap) password for $userName\n" );
343   system("/usr/bin/smbpasswd", "-a", "-d", "$userName")   system("/usr/bin/smbpasswd", "-a", "-d", "$userName")
344  -    and warn("Could not lock smb password for $userName\n");;  -    and warn("Could not lock smb password for $userName\n");;
345  +    and ( $x = 255, warn "Could not lock (smb) password for $userName\n" );  +    and ( $x = 255, warn "Could not lock (smb) password for $userName\n" );
# Line 384  diff -up e-smith-base-5.2.0/root/etc/e-s Line 384  diff -up e-smith-base-5.2.0/root/etc/e-s
384    
385  -exit (0);  -exit (0);
386  +system("/usr/sbin/cpu", "userdel", "-r", $userName) == 0  +system("/usr/sbin/cpu", "userdel", "-r", $userName) == 0
387  +    or ( $x = 255, warn "Failed to delete (ldap) account $userName.\n" );  +    or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to delete (ldap) account $userName.\n" );
388  +  +
389  +system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupdel", $userName) == 0  +system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupdel", $userName) == 0
390  +    or ( $x = 255, warn "Failed to delete (ldap) group account $userName.\n" );  +    or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to delete (ldap) group account $userName.\n" );
391  +  +
392  +exit ($x);  +exit ($x);
393  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-lock-passwd.better-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-lock-passwd  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-lock-passwd.better-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-lock-passwd
# Line 418  diff -up e-smith-base-5.2.0/root/etc/e-s Line 418  diff -up e-smith-base-5.2.0/root/etc/e-s
418  +            or ( $x = 255, warn "Error locking (unix) account $userName" );  +            or ( $x = 255, warn "Error locking (unix) account $userName" );
419       }       }
420  +    system("/usr/sbin/cpu", "usermod", "-L", $userName) == 0  +    system("/usr/sbin/cpu", "usermod", "-L", $userName) == 0
421  +        or ( $x = 255, warn "Error locking (ldap) account $userName" );  +        or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Error locking (ldap) account $userName" );
422       system("/usr/bin/smbpasswd", "-d", $userName) == 0       system("/usr/bin/smbpasswd", "-d", $userName) == 0
423  -        or die "Error running /usr/bin/smbpasswd command to lock account $userName";  -        or die "Error running /usr/bin/smbpasswd command to lock account $userName";
424  +        or ( $x = 255, warn "Error locking (smb) account $userName" );  +        or ( $x = 255, warn "Error locking (smb) account $userName" );
# Line 473  diff -up e-smith-base-5.2.0/root/etc/e-s Line 473  diff -up e-smith-base-5.2.0/root/etc/e-s
473           }           }
474  +  +
475  +        system("/usr/sbin/cpu", "usermod", '-s', "$new_shell", "-G", "$groups", $userName) == 0  +        system("/usr/sbin/cpu", "usermod", '-s', "$new_shell", "-G", "$groups", $userName) == 0
476  +            or ( $x = 255, warn "Failed to modify shell of (ldap) account $userName.\n" );  +            or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify shell of (ldap) account $userName.\n" );
477       }       }
478    
479       #------------------------------------------------------------       #------------------------------------------------------------
# Line 495  diff -up e-smith-base-5.2.0/root/etc/e-s Line 495  diff -up e-smith-base-5.2.0/root/etc/e-s
495           }           }
496  +  +
497  +        system("/usr/sbin/cpu", "usermod", "-c", "$first $last", "-G", "$groups", $userName) == 0  +        system("/usr/sbin/cpu", "usermod", "-c", "$first $last", "-G", "$groups", $userName) == 0
498  +            or ( $x = 255, warn "Failed to modify comment of (ldap) account $userName.\n" );  +            or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify comment of (ldap) account $userName.\n" );
499       }       }
500   }   }
501    


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