Compare commits

...

4 Commits

Author SHA1 Message Date
7738719049 * Mon Sep 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-14.sme
- fix result variable not initialized [SME: 12663]
2024-09-23 09:47:05 -04:00
5a1f39efb3 * Sun Sep 22 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-13.sme
- fix mail spool perms [SME: 12654]
- fix motd noise related to cockpit [SME: 12575]
- fix /run vs /var/run temps dir noise [SME: 12639]
2024-09-22 17:33:04 -04:00
8e4fd3be1e * 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]
2024-08-15 00:05:16 -04:00
c5e0b6f5aa * 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]
2024-08-13 23:40:09 -04:00
12 changed files with 97 additions and 5 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");
@@ -325,6 +326,7 @@ event_link("conf-routes", $event, "89");
event_link("systemd-default", $event, "88");
event_link("systemd-isolate", $event, "89");
event_link("systemd-reload", $event, "89");
event_link("fix-noise-el8", $event, "89");
event_link("raidmonitor-check", $event, "92");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/network");
@@ -457,6 +459,7 @@ event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
event_link("fix-noise-el8", $event, "89");
#--------------------------------------------------
# actions for post-upgrade event
@@ -469,6 +472,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("conf-startup", $event, "10");
@@ -512,6 +516,7 @@ $event = "user-create";
event_link("user-create-unix", $event, "04");
event_link("count-active-user-accounts", $event, "25");
event_link("user-group-modify", $event, "85");
event_link("mail-spool-fix", $event, "89");
#--------------------------------------------------
# actions for user-delete event
@@ -523,6 +528,7 @@ event_link("user-delete-groups-and-pseudonyms", $event, "02");
event_link("user-delete-unix", $event, "15");
event_link("initialize-default-databases", $event, "23");
event_link("count-active-user-accounts", $event, "25");
event_link("mail-spool-fix", $event, "89");
#--------------------------------------------------
# actions for user-modify event
@@ -624,6 +630,7 @@ templates2events("/home/e-smith/ssl.pem/pem", $event);
$event = "email-update";
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
event_link("mail-spool-fix", $event, "89");
#--------------------------------------------------
# actions for webapps-update event

View File

@@ -0,0 +1,2 @@
# cockpit noise [SME: 12575]
cockpit-ws:any:ln -sfn /dev/null /etc/motd.d/cockpit

View File

@@ -0,0 +1,4 @@
#!/bin/bash
# remove cockpit alert forever [SME: 12575]
ln -sfn /dev/null /etc/motd.d/cockpit

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

@@ -0,0 +1,47 @@
#! /bin/bash
#----------------------------------------------------------------------
# copyright (C) 2023 Koozali SME Server
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#----------------------------------------------------------------------
# fix ownership of spool folder content
pushd /var/spool/mail/ >/dev/null
for file in *; do
if [ ! -f "$file" ]; then
continue
fi
if ( ! `id -u $file 2>/dev/null 1>&2`) ; then
echo "$file user does not exist deleting mail spool file"
rm -f /var/spool/mail/$file
continue
fi
userf=$(stat -c %U /var/spool/mail/$file 2>/dev/null)
if [[ "$userf" != "$file" ]]; then
uidf=$(stat -c %u /var/spool/mail/$file 2>/dev/null)
uiduser=$(id -u $file 2>/dev/null )
# extra step needed if username has an alias eg www=apache
if [[ "$uidf" != "$uiduser" ]]; then
echo "fixing ownership of $file spool mail"
# extra security we want to clean it from sensitive information
echo ""> /var/spool/mail/$file
chown $file /var/spool/mail/$file
fi
fi
done
popd >/dev/null

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

@@ -32,6 +32,7 @@ my $a = esmith::AccountsDB->open or die "Could not open accounts db";
my $conf = esmith::ConfigDB->open or die "Could not open configuration db";
my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
my $result;
my $x = 0; # exit value
# prepare LDAP bind

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

@@ -2,7 +2,7 @@
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/usr/bin/systemctl -s HUP kill rsyslog.service >/dev/null 2>&1 || true
endscript
}

View File

@@ -0,0 +1 @@
d /run/portreserve 0755 root root 10d

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 10
%define release 14
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -184,6 +184,23 @@ fi
%changelog
* Mon Sep 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-14.sme
- fix result variable not initialized [SME: 12663]
* Sun Sep 22 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-13.sme
- fix mail spool perms [SME: 12654]
- fix motd noise related to cockpit [SME: 12575]
- fix /run vs /var/run temps dir noise [SME: 12639]
* 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]
* Wed May 15 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-10.sme
- fix user@0.service failed to start [SME: 12568]
- stop loging in audit crond success