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 --- e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/group-modify-unix 2023-11-23 22:44:01.688000000 -0500 +++ e-smith-base-5.8.1/root/etc/e-smith/events/actions/group-modify-unix 2023-11-23 22:54:12.328000000 -0500 @@ -51,6 +51,11 @@ @groups = $a->groups; } +# fix www missing in shared +my ( $name, $passwd, $gid, $members ) = getgrnam('shared'); +my @mb= split(/ /, $members); +system("usermod -a -G shared www") unless ( "www" ~~ @mb ) ; + foreach my $group (@groups) { my $groupName = $group->key; @@ -128,7 +133,9 @@ # We need to add or remove this member from the group # Get the supplementary group list for the member we are adding or # deleting. - my $cmd = "/usr/bin/id -G -n '$member'"; + #my $cmd = "/usr/bin/id -G -n '$member'"; + # this will not fail in case of apache aliase before www in passwd + my $cmd = "/usr/bin/groups '$member' 2>/dev/null | cut -d' ' -f3- "; my $groups = `$cmd 2>/dev/null`; if ($? != 0) { @@ -140,6 +147,8 @@ @groupList = grep (!/^$member$/, @groupList); # Apache is an alias for www @groupList = map { $_ =~ s/^apache$/www/g; $_ } @groupList; + # www needs to be in shared + push(@groupList,'shared') if ( ($member eq 'www') and (! grep{$_ eq 'shared'} @groupList)); if ($oldMembers{$member}) {