/[smeserver]/rpms/e-smith-base/sme10/e-smith-base-5.8.1-bz12146-fix-www-in-shared.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme10/e-smith-base-5.8.1-bz12146-fix-www-in-shared.patch

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


Revision 1.1 - (show annotations) (download)
Fri Nov 24 04:01:31 2023 UTC (11 months, 2 weeks ago) by jpp
Branch: MAIN
CVS Tags: e-smith-base-5_8_1-31_el7_sme, HEAD
Error occurred while calculating annotation data.
* Thu Nov 23 2023 Jean-Philippe Pialasse <tests@pialasse.com> 5.8.1-31.sme
- fix www missing from shared and few groups [SME: 12146]

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 {

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