* Wed Aug 14 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme

- fix 3 regressions from SME10 [SME: 12654]
  fix www missing from shared and few groups [SME: 12146]
  fix group deletion leaves mail spool file [SME: 12431]
  fix path to /etc/systemd for seeking service files [SME: 12421]
This commit is contained in:
Jean-Philippe Pialasse 2024-08-15 00:05:16 -04:00
parent c5e0b6f5aa
commit 8e4fd3be1e
6 changed files with 24 additions and 4 deletions

View File

@ -309,6 +309,7 @@ templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $even
event_link("systemd-journald", $event, "02");
event_link("fix-startup", $event, "05");
event_link("init-accounts", $event, "05");
event_link("mail-spool-fix", $event, "05");
event_link("logrotate-migrate", $event, "06");
event_link("rotate_logfiles", $event, "07");
event_link("set-hostname", $event, "10");

View File

@ -59,4 +59,7 @@ $result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete dumm
$result = $ldap->ldapdelgroup($groupName);
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) group $groupName.\n" );
# delete mail spool file
unless ($x == 255) { unlink("/var/spool/mail/$groupName") or ( $x = 255, warn "Failed to delete /var/spool/mail/$groupName.\n" );}
exit ($x);

View File

@ -54,6 +54,11 @@ else
@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 ( grep(/^www$/, @mb) ) ;
foreach my $group (@groups)
{
my $groupName = $group->key;
@ -125,18 +130,23 @@ foreach my $group (@groups)
# 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 before www in passwd
my $cmd = "/usr/bin/groups '$member'";
my $groups = `$cmd 2>/dev/null`;
if ($? != 0)
{
die "Failed to get supplementary group list for $member.\n";
}
$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));
if ($oldMembers{$member})
{

View File

@ -105,7 +105,7 @@ foreach my $filen (reverse sort keys %files) {
my $multiple = $service;
($multiple = $service ) =~ s/([a-zA-Z0-9\-_.]+@)(.*)/$1.service/ if ( $service =~ /@/ );
#print "$stats $service $multiple\n";
next unless ( -e "/usr/lib/systemd/system/$service" or -e "/etc/lib/systemd/system/$service" or -e "/usr/lib/systemd/system/$multiple");
next unless ( -e "/usr/lib/systemd/system/$service" or -e "/etc/systemd/system/$service" or -e "/usr/lib/systemd/system/$multiple");
# eliminate duplicates, this way we keep only the last entry of the lowest file as we do it in reverse order of file,
# but from top to bottom of file.
$services{$service}=$stats;

View File

@ -11,7 +11,7 @@ foreach my $service ($c->get_all_by_prop(type => 'service')){
my $multiple = $servicename;
($multiple = $servicename ) =~ s/([a-zA-Z0-9\-_.]+@)(.*)/$1.service/ if ( $servicename =~ /@/ );
$OUT .= "# Systemd service file does not exist : " unless -e "/usr/lib/systemd/system/$servicename" || -e "/etc/lib/systemd/system/$servicename" || -e "/usr/lib/systemd/system/$multiple";
$OUT .= "# Systemd service file does not exist : " unless -e "/usr/lib/systemd/system/$servicename" || -e "/etc/systemd/system/$servicename" || -e "/usr/lib/systemd/system/$multiple";
$OUT .= "$status $servicename\n";
$OUT .= "$status $multiple\n" unless $multiple eq $servicename ;

View File

@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module
%define name smeserver-base
Name: %{name}
%define version 11.0.0
%define release 11
%define release 12
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@ -184,6 +184,12 @@ fi
%changelog
* Wed Aug 14 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- fix 3 regressions from SME10 [SME: 12654]
fix www missing from shared and few groups [SME: 12146]
fix group deletion leaves mail spool file [SME: 12431]
fix path to /etc/systemd for seeking service files [SME: 12421]
* Tue Aug 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix new systemd.log does not fill after log rotate [SME: 12688]