From 4e744a321224d5901312222e95745a51ed123c6d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Tue, 13 Aug 2024 22:04:32 -0400 Subject: [PATCH] * Tue Aug 13 2024 Jean-Philippe Pialasse 11.0.0-8.sme - ldif-fix filter string accepting only ascii [SME: 12720] - fix logrotate does not fill new log [SME: 12673] - fix prestart script logs to messages [SME: 12693] --- root/etc/logrotate.d/ldap | 2 +- root/sbin/e-smith/ldif-fix | 6 ++++-- root/usr/lib/systemd/system/ldap.service | 1 + smeserver-ldap.spec | 9 +++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/root/etc/logrotate.d/ldap b/root/etc/logrotate.d/ldap index cc4b31f..70315fb 100644 --- a/root/etc/logrotate.d/ldap +++ b/root/etc/logrotate.d/ldap @@ -6,6 +6,6 @@ sharedscripts postrotate # OpenLDAP logs via syslog, restart syslog if running - /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + /usr/bin/systemctl -s HUP kill rsyslog.service 2> /dev/null || true endscript } diff --git a/root/sbin/e-smith/ldif-fix b/root/sbin/e-smith/ldif-fix index 72da602..8392206 100644 --- a/root/sbin/e-smith/ldif-fix +++ b/root/sbin/e-smith/ldif-fix @@ -8,6 +8,8 @@ use Date::Parse; use esmith::ConfigDB; use esmith::AccountsDB; use esmith::util; +use utf8; +use esmith::util::ldap; use Getopt::Long qw(:config bundling); $ENV{'PATH'} = '/bin:/usr/bin:/sbin:/usr/sbin'; @@ -97,8 +99,8 @@ foreach my $acct ($a->get('admin'), $a->users, $a->groups, $a->ibays, $a->get_al push @{$data->{$dn}->{objectclass}}, 'inetOrgPerson'; $data->{$dn}->{mail} = "$key\@$domain"; @{$data->{$dn}}{qw/givenname sn telephonenumber o ou l street/} = - map { $acct->prop($_) || [] } qw/FirstName LastName Phone Company Dept City Street/; - $data->{$dn}->{cn} = $acct->prop('FirstName').' '.$acct->prop('LastName'); + map { stringToASCII($acct->prop($_)) || [] } qw/FirstName LastName Phone Company Dept City Street/; + $data->{$dn}->{cn} = stringToASCII($acct->prop('FirstName').' '.$acct->prop('LastName')); } else { push @{$data->{$dn}->{objectclass}}, 'account'; diff --git a/root/usr/lib/systemd/system/ldap.service b/root/usr/lib/systemd/system/ldap.service index e971604..130a3ae 100644 --- a/root/usr/lib/systemd/system/ldap.service +++ b/root/usr/lib/systemd/system/ldap.service @@ -21,6 +21,7 @@ TimeoutStartSec=300 Restart=always ExecStopPost=/sbin/e-smith/systemd/ldap-finish +SyslogIdentifier=ldap [Install] WantedBy=sme-server.target diff --git a/smeserver-ldap.spec b/smeserver-ldap.spec index f326bbc..3952b2a 100644 --- a/smeserver-ldap.spec +++ b/smeserver-ldap.spec @@ -4,7 +4,7 @@ Summary: smeserver server and gateway - LDAP module %define name smeserver-ldap Name: %{name} %define version 11.0.0 -%define release 7 +%define release 8 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -14,7 +14,7 @@ Source: %{name}-%{version}.tar.xz BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch Requires: smeserver-base -Requires: smeserver-lib >= 1.15.1-16 +Requires: smeserver-lib >= 11.0.0-7 Requires: openldap >= 2.0.0 Requires: openldap-clients Requires: openldap-servers @@ -29,6 +29,11 @@ Provides: e-smith-ldap smeserver server and gateway software - LDAP module. %changelog +* Tue Aug 13 2024 Jean-Philippe Pialasse 11.0.0-8.sme +- ldif-fix filter string accepting only ascii [SME: 12720] +- fix logrotate does not fill new log [SME: 12673] +- fix prestart script logs to messages [SME: 12693] + * Wed Apr 17 2024 Jean-Philippe Pialasse 11.0.0-7.sme - fix ldap.init fails as starts before samba [SME: 12570]