From a0dda9c806f052db19a0fa050cf516d06b36a49909ad571a92d03c96384a1687 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Mon, 4 Jan 2021 17:53:11 +0000 Subject: [PATCH] Accepting request 851366 from home:kukuk:branches:network - Support /usr/etc/pam.d OBS-URL: https://build.opensuse.org/request/show/851366 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=220 --- openssh.changes | 5 +++++ openssh.spec | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/openssh.changes b/openssh.changes index a7ae76d..1accd97 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Nov 27 11:36:56 UTC 2020 - Thorsten Kukuk + +- Support /usr/etc/pam.d + ------------------------------------------------------------------- Wed Nov 11 20:05:27 UTC 2020 - Hans Petter Jansson diff --git a/openssh.spec b/openssh.spec index fbd1601..82f8ae5 100644 --- a/openssh.spec +++ b/openssh.spec @@ -290,10 +290,14 @@ export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS %install %make_install - +%if %{defined _distconfdir} +install -d -m 755 %{buildroot}%{_distconfdir}/pam.d +install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/pam.d/sshd +%else install -d -m 755 %{buildroot}%{_sysconfdir}/pam.d -install -d -m 755 %{buildroot}%{_localstatedir}/lib/sshd install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sshd +%endif +install -d -m 755 %{buildroot}%{_localstatedir}/lib/sshd install -d -m 755 %{buildroot}%{_sysconfdir}/slp.reg.d/ install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/slp.reg.d/ install -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sshd.service @@ -350,6 +354,11 @@ fi %pre server getent group sshd >/dev/null || %{_sbindir}/groupadd -r sshd getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d %{_localstatedir}/lib/sshd -s /bin/false -c "SSH daemon" sshd +%if %{defined _distconfdir} +# move outdated pam.d/*.rpmsave file away +test -f /etc/pam.d/sshd.rpmsave && mv -v /etc/pam.d/sshd.rpmsave /etc/pam.d/sshd.rpmsave.old ||: +%endif + # See %%pre. if [ -x %{_bindir}/systemctl ]; then @@ -386,6 +395,13 @@ else %service_del_postun sshd.service fi +%if %{defined _distconfdir} +%posttrans server +# Migration to /usr/etc. +test -f /etc/pam.d/sshd.rpmsave && mv -v /etc/pam.d/sshd.rpmsave /etc/pam.d/sshd ||: +%endif + + %triggerin -n openssh-fips -- %{name} = %{version}-%{release} %restart_on_update sshd @@ -412,7 +428,11 @@ fi %attr(0755,root,root) %{_sbindir}/sshd-gen-keys-start %dir %attr(755,root,root) %{_localstatedir}/lib/sshd %verify(not mode) %attr(0640,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config +%if %{defined _distconfdir} +%attr(0644,root,root) %{_distconfdir}/pam.d/sshd +%else %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/sshd +%endif %attr(0644,root,root) %{_unitdir}/sshd.service %attr(0444,root,root) %{_mandir}/man5/sshd_config* %attr(0444,root,root) %{_mandir}/man8/sftp-server.8*