From 5b938b298709eefdd7fd2dd385216e27dad3c905 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Tue, 31 Dec 2024 03:29:03 -0500 Subject: [PATCH] * Tue Dec 31 2024 Jean-Philippe Pialasse 11.0.0-19.sme - fix www removed from shared on group creation [SME: 12848] --- root/etc/e-smith/events/actions/group-create-unix | 4 +++- root/etc/e-smith/events/actions/group-modify-unix | 10 +++++----- smeserver-base.spec | 5 ++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/root/etc/e-smith/events/actions/group-create-unix b/root/etc/e-smith/events/actions/group-create-unix index 3b92a8b..a21cf3f 100755 --- a/root/etc/e-smith/events/actions/group-create-unix +++ b/root/etc/e-smith/events/actions/group-create-unix @@ -137,7 +137,9 @@ foreach my $member (@groupMembers) # new group to the list. Finally sort, join and run the usermod # function to update the group list for this member. - 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) { diff --git a/root/etc/e-smith/events/actions/group-modify-unix b/root/etc/e-smith/events/actions/group-modify-unix index 3de489c..84f2ae9 100755 --- a/root/etc/e-smith/events/actions/group-modify-unix +++ b/root/etc/e-smith/events/actions/group-modify-unix @@ -131,22 +131,22 @@ foreach my $group (@groups) # Get the supplementary group list for the member we are adding or # deleting. #my $cmd = "/usr/bin/id -G -n '$member'"; - # this will not fail in case of apache before www in passwd - my $cmd = "/usr/bin/groups '$member'"; + # this will not fail in case of apache before www in passwd + my $cmd = "/usr/bin/groups '$member' 2>/dev/null | cut -d' ' -f3- "; my $groups = `$cmd 2>/dev/null`; if ($? != 0) { die "Failed to get supplementary group list for $member.\n"; } - $groups =~ s/^.*:\s+//; + $groups =~ s/^.*:\s+//; chomp ($groups); my @groupList = split (/\s+/, $groups); @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)); + # www needs to be in shared + push(@groupList,'shared') if ( ($member eq 'www') and (! grep{$_ eq 'shared'} @groupList)); if ($oldMembers{$member}) { diff --git a/smeserver-base.spec b/smeserver-base.spec index a19afb8..9f6db96 100644 --- a/smeserver-base.spec +++ b/smeserver-base.spec @@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module %define name smeserver-base Name: %{name} %define version 11.0.0 -%define release 18 +%define release 19 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -184,6 +184,9 @@ fi %changelog +* Tue Dec 31 2024 Jean-Philippe Pialasse 11.0.0-19.sme +- fix www removed from shared on group creation [SME: 12848] + * Mon Dec 23 2024 Jean-Philippe Pialasse 11.0.0-18.sme - add vlan support on External Interface [SME: 12677] - fix typo [SME: 12763]