From ad988d08a410fee4695970ae20da3471ed54ab3857891dba9f0059ab7e275af5 Mon Sep 17 00:00:00 2001 From: Pedro Monreal Gonzalez Date: Mon, 21 Dec 2020 12:04:39 +0000 Subject: [PATCH 1/2] Accepting request 856925 from home:kukuk:container - Don't require systemd - Use tmpfiles for all files - Use systemd macro for tmpfiles - Don't delete home directory if the user stays - Use sysusers config to create system user OBS-URL: https://build.opensuse.org/request/show/856925 OBS-URL: https://build.opensuse.org/package/show/server:mail/fetchmail?expand=0&rev=102 --- fetchmail.changes | 9 +++++++++ fetchmail.spec | 30 +++++++++++------------------- fetchmail.sysusers | 3 +++ fetchmail.tmpfiles | 3 ++- 4 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 fetchmail.sysusers diff --git a/fetchmail.changes b/fetchmail.changes index 45bc58a..40ad444 100644 --- a/fetchmail.changes +++ b/fetchmail.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Dec 18 09:39:19 UTC 2020 - Thorsten Kukuk + +- Don't require systemd +- Use tmpfiles for all files +- Use systemd macro for tmpfiles +- Don't delete home directory if the user stays +- Use sysusers config to create system user + ------------------------------------------------------------------- Fri Sep 4 20:22:16 UTC 2020 - Dirk Mueller diff --git a/fetchmail.spec b/fetchmail.spec index 0c57a9b..0cd8114 100644 --- a/fetchmail.spec +++ b/fetchmail.spec @@ -34,6 +34,7 @@ Source5: %{name}.keyring Source6: %{name}.service Source7: %{name}.tmpfiles Source8: %{name}.exec +Source9: %{name}.sysusers Patch0: fetchmail-6.3.8-smtp_errors.patch BuildRequires: automake BuildRequires: krb5-devel @@ -44,14 +45,13 @@ BuildRequires: procmail BuildRequires: python3-base BuildRequires: shadow BuildRequires: systemd-rpm-macros +BuildRequires: sysuser-shadow +BuildRequires: sysuser-tools BuildRequires: xz Requires: logrotate Requires(pre): %fillup_prereq -Requires(pre): coreutils -Requires(pre): group(daemon) -Requires(pre): shadow Suggests: smtp_daemon -%{?systemd_requires} +%sysusers_requires %description Fetchmail is a robust and well-documented remote mail retrieval and @@ -94,6 +94,7 @@ export CFLAGS="%{optflags} -fPIE" --with-gssapi \ --with-ssl=%{_prefix} %make_build LDFLAGS="-pie" +%sysusers_generate_pre %{SOURCE9} fetchmail %install %make_install @@ -103,9 +104,11 @@ cp fetchmail.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/fetchmail mkdir -p %{buildroot}/sbin mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_tmpfilesdir} +mkdir -p %{buildroot}%{_sysusersdir} sed -e 's-@LIBEXECDIR@-%{_libexecdir}-g' -i %{SOURCE6} install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service install -m 0644 %{SOURCE7} %{buildroot}%{_tmpfilesdir}/%{name}.conf +install -m 0644 %{SOURCE9} %{buildroot}%{_sysusersdir}/%{name}.conf mkdir -p %{buildroot}%{_libexecdir} install -m 0755 %{SOURCE8} %{buildroot}%{_libexecdir}/%{name}-systemd-exec mkdir -p %{buildroot}%{_sbindir} @@ -121,31 +124,19 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/fetchmail rm -r contrib/gai* %find_lang %{name} -%pre -%{_bindir}/getent passwd fetchmail >/dev/null || \ - %{_sbindir}/useradd -r -g daemon -s /bin/false \ - -c "mail retrieval daemon" -d %{_localstatedir}/lib/fetchmail fetchmail || : +%pre -f fetchmail.pre %service_add_pre %{name}.service %post %fillup_only +%tmpfiles_create %{name}.conf %service_add_post %{name}.service -if [ -x %{_bindir}/systemd-tmpfiles ]; then - systemd-tmpfiles --create %{name}.conf || : -fi -# Ensure that all files are readable by fetchmail with non-root UID. -touch var/log/fetchmail -chown fetchmail var/log/fetchmail -chmod 0600 var/log/fetchmail %preun %service_del_preun %{name}.service %postun %service_del_postun %{name}.service -if [ $1 = 0 ]; then - rm -rf var/lib/fetchmail -fi %check %make_build check @@ -154,7 +145,7 @@ fi %license COPYING %doc FAQ FEATURES NEWS NOTES OLDNEWS README README.NTLM README.SSL README.SSL-SERVER TODO contrib *.html *.txt *.pdf %{_bindir}/fetchmail -%dir %attr(0700, fetchmail, root) %{_localstatedir}/lib/fetchmail +%dir %attr(0700, fetchmail, fetchmail) %{_localstatedir}/lib/fetchmail %ghost %attr(0600, fetchmail, root) %{_localstatedir}/log/fetchmail %{_mandir}/man1/fetchmail.1%{?ext_man} %ghost %config(noreplace) %attr(0600, fetchmail, root) %{_sysconfdir}/fetchmailrc @@ -163,6 +154,7 @@ fi %{_sbindir}/rc%{name} %{_libexecdir}/%{name}-systemd-exec %{_tmpfilesdir}/%{name}.conf +%{_sysusersdir}/%{name}.conf %{_fillupdir}/sysconfig.%{name} %files -n fetchmailconf diff --git a/fetchmail.sysusers b/fetchmail.sysusers new file mode 100644 index 0000000..c3cefac --- /dev/null +++ b/fetchmail.sysusers @@ -0,0 +1,3 @@ +# Type Name ID GECOS [HOME] +u fetchmail - "mail retrieval daemon" /var/lib/fetchmail + diff --git a/fetchmail.tmpfiles b/fetchmail.tmpfiles index 3edf268..6fe8526 100644 --- a/fetchmail.tmpfiles +++ b/fetchmail.tmpfiles @@ -1 +1,2 @@ -d /run/fetchmail 700 fetchmail nobody +d /run/fetchmail 700 fetchmail fetchmail +f /var/log/fetchmail 600 fetchmail root From 0dfa3d6124dda4f8117f12e0465c0277d2e16af55837d7c571f8552b0cded42a Mon Sep 17 00:00:00 2001 From: Pedro Monreal Gonzalez Date: Mon, 21 Dec 2020 12:15:21 +0000 Subject: [PATCH 2/2] Accepting request 856963 from home:dirkmueller:branches:server:mail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update to 6.4.14: * sr: Мирослав Николић (Miroslav Nikolić) [Serbian] * Errors about lock file (= pidfile) creation could be lost in daemon configurations (-d option, or set daemon) when using syslog. Now they are also logged to syslog. Found verifying a pidfile creation issue on 6.4.12 that was previously reported by Alex Hall of Automatic Distributors. * If the lock file cannot be removed (no write permission on directory), try to truncate it, and if that fails, report error. * If the pidfile was non-default, fetchmail -q or --quit would malfunction and claim no other fetchmail were running, because it did not read the configuration files or merge the command line options, thus it would look for the PID in the wrong file. OBS-URL: https://build.opensuse.org/request/show/856963 OBS-URL: https://build.opensuse.org/package/show/server:mail/fetchmail?expand=0&rev=103 --- fetchmail-6.4.12.tar.xz | 3 --- fetchmail-6.4.12.tar.xz.asc | 16 ---------------- fetchmail-6.4.14.tar.xz | 3 +++ fetchmail-6.4.14.tar.xz.asc | 16 ++++++++++++++++ fetchmail.changes | 16 ++++++++++++++++ fetchmail.spec | 2 +- 6 files changed, 36 insertions(+), 20 deletions(-) delete mode 100644 fetchmail-6.4.12.tar.xz delete mode 100644 fetchmail-6.4.12.tar.xz.asc create mode 100644 fetchmail-6.4.14.tar.xz create mode 100644 fetchmail-6.4.14.tar.xz.asc diff --git a/fetchmail-6.4.12.tar.xz b/fetchmail-6.4.12.tar.xz deleted file mode 100644 index f443785..0000000 --- a/fetchmail-6.4.12.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2b84e0971dbf683ec7edd313f9218adbc7dc51c1de9825b3b549bf619c1a4887 -size 1303532 diff --git a/fetchmail-6.4.12.tar.xz.asc b/fetchmail-6.4.12.tar.xz.asc deleted file mode 100644 index bf0d026..0000000 --- a/fetchmail-6.4.12.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEE3EplW9mTzUhx+oIQ5BKxVu/zhVoFAl9R+MMACgkQ5BKxVu/z -hVoe1hAAztKN0k0zT+M2a5qOPfTLUlzBSgWZdG1VGjyNO/BNrvdo206qPX53b9NS -YaaV6m02VyIvP0q4bEjXYhkzL9Hxw7kQ/qIISxW0s+n8hAVWTeQGN31HPdzfMrVm -yirTu4WZ1zzCOiL5PmkOLfd/FChdATjEmbXoKEuL0vuSjdrJ5Q8FuM/GB2UnfPQg -5bGtjQQHq1tFH6v9DZST1+iIz3FCIe9rjC8X2DwYfWFpecqXPElavW2aUnJl2aWG -tX4YEUOg+G6ogv4QhhVS5SBC63A/ywBW62kFxNjBQVmxZ1+PzJzqM5Zm4zeM01R6 -cj3UYvMvovm2aC3AejJYRUdYdKb/ramklArSaJnyBcJdpA4+t742+b5Mgls2qY4s -EcXsNm5xiHmoVxec0Y2Su9fWPT524dOEAaU2pp8Brx2dP5WZ4dA3MSm+lEyz2aBN -0mYiCURg0qhOo7M039pMNxINPdwaki3OhS+NaUoqFpwG2JKxk4nwpylK03C7Pj1s -LWIqMLrWdAMJ++XoJ2pQWUo0OcTv4GaBq6XuwIO8jP7b8+3mrEDyoZsJSQzbF+YD -AbC4uLmoqJWcmy0nMUUkDGpvo8ndp4a69kIQy5cESlJKdNP6F0C7DSwuUFAkhXuI -Xxyzjb5Nir2R67wGOxM6i35rQzwrASwQvP7HMDDYK1Ckt0PeG1M= -=JnHm ------END PGP SIGNATURE----- diff --git a/fetchmail-6.4.14.tar.xz b/fetchmail-6.4.14.tar.xz new file mode 100644 index 0000000..c9d8b8c --- /dev/null +++ b/fetchmail-6.4.14.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:424707390f7cdc6d16db4887931117f2242873846b28cc1d0ae1c0ecf158bdcb +size 1309352 diff --git a/fetchmail-6.4.14.tar.xz.asc b/fetchmail-6.4.14.tar.xz.asc new file mode 100644 index 0000000..2a95275 --- /dev/null +++ b/fetchmail-6.4.14.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE3EplW9mTzUhx+oIQ5BKxVu/zhVoFAl+/gpwACgkQ5BKxVu/z +hVqFlRAAszL77wnZd4w3fRjZ5e5pW2QWSXqbjj6TLuhai63dnldq3ZVR0RpX5fQf +4FnavDriVnC2dwkA5M1koCG97DtMkmvWQ1NmMAUW9VOS09aQqLhWEN83t95iVG7p +dj3Q5LBG6CyTXLK1wHMaOAPyCaDJr31KFI+TmZk9e8ynUeCgSP4DHfvC22vtVYAY +2nnx0hauSVvHtBz5fdUEVoP/DyADDRpUPM0edEwmD13sLpP30uKr3BAGGsha7UL4 +qqUSsWE3IWZMZpDuy8B5P6mRBYOWWzR3m4Rel7NoONjrAqlrgrGHCFenXoH+XL1Q +rxNLtm72FwNZNsbB2jRDQWX/LG4McaF2O6dnXA7JAoxqMU5tX05LRUPGkMX2PDhr +gEHlWk4cNL2I63l3JNgHV1e0V8Ce4J61hiL+qmQETDuGcPwxDoB2X/YVtPvdSbqe +BT/c7im7Io3R9Kyb9SGB77hsdgwM6Yu0OyW1t6JQSfmbyOh+MorO42kDxIxxITl/ +ub75ks1OFDiLFwnXoOGXyral5K7gCuPwqEmIqCcGMj2dubWMsW7FdwvR8/3bSnYg +nHkzeSjyDF9OLqIEf5Sf+hIrpip23Z+QJ9NQdY4sE9iKa7XZr9RpO3oIn5DmVnOT +YAitRkEviKIHmfsBo7tTxpgMWxZ9KzhFCbVAOo0i86v18MnM7Ng= +=iThh +-----END PGP SIGNATURE----- diff --git a/fetchmail.changes b/fetchmail.changes index 40ad444..8ed2c6e 100644 --- a/fetchmail.changes +++ b/fetchmail.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Sat Dec 19 09:52:39 UTC 2020 - Dirk Mueller + +- update to 6.4.14: + * sr: Мирослав Николић (Miroslav Nikolić) [Serbian] + * Errors about lock file (= pidfile) creation could be lost in daemon + configurations (-d option, or set daemon) when using syslog. Now they are also + logged to syslog. Found verifying a pidfile creation issue on 6.4.12 that was + previously reported by Alex Hall of Automatic Distributors. + * If the lock file cannot be removed (no write permission on directory), try + to truncate it, and if that fails, report error. + * If the pidfile was non-default, fetchmail -q or --quit would malfunction and + claim no other fetchmail were running, because it did not read the + configuration files or merge the command line options, thus it would look for + the PID in the wrong file. + ------------------------------------------------------------------- Fri Dec 18 09:39:19 UTC 2020 - Thorsten Kukuk diff --git a/fetchmail.spec b/fetchmail.spec index 0cd8114..8f3b4c5 100644 --- a/fetchmail.spec +++ b/fetchmail.spec @@ -21,7 +21,7 @@ %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif Name: fetchmail -Version: 6.4.12 +Version: 6.4.14 Release: 0 Summary: Full-Featured POP and IMAP Mail Retrieval Daemon License: GPL-2.0-or-later