/[smeserver]/rpms/e-smith-base/sme8/e-smith-base-5.2.0-supp-groups.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme8/e-smith-base-5.2.0-supp-groups.patch

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


Revision 1.1 - (show annotations) (download)
Mon Nov 8 03:58:38 2010 UTC (13 years, 11 months ago) by slords
Branch: MAIN
CVS Tags: e-smith-base-5_2_0-67_el5_sme, e-smith-base-5_2_0-71_el5_sme, e-smith-base-5_2_0-52_el5_sme, e-smith-base-5_2_0-51_el5_sme, e-smith-base-5_2_0-53_el5_sme, e-smith-base-5_2_0-68_el5_sme, e-smith-base-5_2_0-77_el5_sme, e-smith-base-5_2_0-59_el5_sme, e-smith-base-5_2_0-56_el5_sme, e-smith-base-5_2_0-55_el5_sme, e-smith-base-5_2_0-78_el5_sme, e-smith-base-5_2_0-86_el5_sme, e-smith-base-5_2_0-76_el5_sme, e-smith-base-5_2_0-84_el5_sme, e-smith-base-5_2_0-65_el5_sme, e-smith-base-5_2_0-88_el5_sme, e-smith-base-5_2_0-64_el5_sme, e-smith-base-5_2_0-81_el5_sme, e-smith-base-5_2_0-82_el5_sme, e-smith-base-5_2_0-57_el5_sme, e-smith-base-5_2_0-89_el5_sme, e-smith-base-5_2_0-90_el5_sme, e-smith-base-5_2_0-87_el5_sme, e-smith-base-5_2_0-80_el5_sme, e-smith-base-5_2_0-70_el5_sme, e-smith-base-5_2_0-66_el5_sme, e-smith-base-5_2_0-63_el5_sme, e-smith-base-5_2_0-61_el5_sme, e-smith-base-5_2_0-60_el5_sme, e-smith-base-5_2_0-58_el5_sme, e-smith-base-5_2_0-85_el5_sme, e-smith-base-5_2_0-69_el5_sme, e-smith-base-5_2_0-79_el5_sme, e-smith-base-5_2_0-72_el5_sme, e-smith-base-5_2_0-75_el5_sme, e-smith-base-5_2_0-73_el5_sme, e-smith-base-5_2_0-54_el5_sme, e-smith-base-5_2_0-62_el5_sme, e-smith-base-5_2_0-74_el5_sme, e-smith-base-5_2_0-83_el5_sme
* Sun Nov 7 2010 Shad L. Lords <slords@lordsfam.net 5.2.0-51.sme
- No longer need to pass supplemental groups to cpu [SME: 6349]

1 diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix.supp-groups e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix
2 --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix.supp-groups 2010-11-07 20:52:51.000000000 -0700
3 +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix 2010-11-07 20:55:37.000000000 -0700
4 @@ -62,25 +62,6 @@ foreach my $u (@users)
5 die "Account $userName is not a user account; modify user failed.\n"
6 unless ( ($userName eq 'admin') or ($type eq 'user') );
7
8 - # cpu usermod called without "-G list,of,supplementary,groups" causes user
9 - # to be removed from all it's supplementary groups. Thus, to be able to call
10 - # cpu usermod properly we need to know user supplementary groups.
11 -
12 - my $cmd = "/usr/bin/id -G -n '$userName'";
13 - my $groups = `$cmd 2>/dev/null`;
14 - if ($? != 0)
15 - {
16 - die "Failed to get supplementary group list for $userName.\n";
17 - }
18 - chomp ($groups);
19 -
20 - my @groupList = split (/\s+/, $groups);
21 - @groupList = grep (!/^$userName$/, @groupList);
22 -
23 - # root user/group isn't in ldap
24 - @groupList = grep (!/^root$/, @groupList);
25 - $groups = join (',', sort (@groupList));
26 -
27 setpwent;
28 my ($comment, $shell) = (getpwnam($userName))[5,8];
29 endpwent;
30 @@ -100,7 +81,7 @@ foreach my $u (@users)
31 or ( $x = 255, warn "Failed to modify shell of (unix) account $userName.\n" );
32 }
33
34 - system("/usr/sbin/cpu", "usermod", '-s', "$new_shell", "-G", "$groups", $userName) == 0
35 + system("/usr/sbin/cpu", "usermod", '-s', "$new_shell", $userName) == 0
36 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify shell of (ldap) account $userName.\n" );
37 }
38
39 @@ -120,7 +101,7 @@ foreach my $u (@users)
40 or ( $x = 255, warn "Failed to modify comment of (unix) account $userName.\n" );
41 }
42
43 - system("/usr/sbin/cpu", "usermod", "-c", "$first $last", "-f", "$first", "-E", "$last", "-G", "$groups", $userName) == 0
44 + system("/usr/sbin/cpu", "usermod", "-c", "$first $last", "-f", "$first", "-E", "$last", $userName) == 0
45 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify comment/name of (ldap) account $userName.\n" );
46 }
47
48 @@ -137,7 +118,7 @@ foreach my $u (@users)
49 print $tmpattr "l: $new_city\n";
50 print $tmpattr "street: $new_street\n";
51 $tmpattr->flush();
52 - system("/usr/sbin/cpu", "usermod", "-a", "$tmpattr", "-e", "$userName\@$domain", "-G", "$groups", $userName) == 0
53 + system("/usr/sbin/cpu", "usermod", "-a", "$tmpattr", "-e", "$userName\@$domain", $userName) == 0
54 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify email of (ldap) account $userName.\n" );
55 undef $tmpattr;
56 }

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