1 |
jpp |
1.1 |
diff -Nur --no-dereference e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/group-modify-unix e-smith-base-5.8.1/root/etc/e-smith/events/actions/group-modify-unix |
2 |
|
|
--- e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/group-modify-unix 2023-11-23 22:44:01.688000000 -0500 |
3 |
|
|
+++ e-smith-base-5.8.1/root/etc/e-smith/events/actions/group-modify-unix 2023-11-23 22:54:12.328000000 -0500 |
4 |
|
|
@@ -51,6 +51,11 @@ |
5 |
|
|
@groups = $a->groups; |
6 |
|
|
} |
7 |
|
|
|
8 |
|
|
+# fix www missing in shared |
9 |
|
|
+my ( $name, $passwd, $gid, $members ) = getgrnam('shared'); |
10 |
|
|
+my @mb= split(/ /, $members); |
11 |
|
|
+system("usermod -a -G shared www") unless ( "www" ~~ @mb ) ; |
12 |
|
|
+ |
13 |
|
|
foreach my $group (@groups) |
14 |
|
|
{ |
15 |
|
|
my $groupName = $group->key; |
16 |
|
|
@@ -128,7 +133,9 @@ |
17 |
|
|
# We need to add or remove this member from the group |
18 |
|
|
# Get the supplementary group list for the member we are adding or |
19 |
|
|
# deleting. |
20 |
|
|
- my $cmd = "/usr/bin/id -G -n '$member'"; |
21 |
|
|
+ #my $cmd = "/usr/bin/id -G -n '$member'"; |
22 |
|
|
+ # this will not fail in case of apache aliase before www in passwd |
23 |
|
|
+ my $cmd = "/usr/bin/groups '$member' 2>/dev/null | cut -d' ' -f3- "; |
24 |
|
|
my $groups = `$cmd 2>/dev/null`; |
25 |
|
|
if ($? != 0) |
26 |
|
|
{ |
27 |
|
|
@@ -140,6 +147,8 @@ |
28 |
|
|
@groupList = grep (!/^$member$/, @groupList); |
29 |
|
|
# Apache is an alias for www |
30 |
|
|
@groupList = map { $_ =~ s/^apache$/www/g; $_ } @groupList; |
31 |
|
|
+ # www needs to be in shared |
32 |
|
|
+ push(@groupList,'shared') if ( ($member eq 'www') and (! grep{$_ eq 'shared'} @groupList)); |
33 |
|
|
|
34 |
|
|
if ($oldMembers{$member}) |
35 |
|
|
{ |