SHA256
1
0
forked from cockpit/cockpit

Accepting request 1063688 from home:schubi2:pam_usr_etc

- Migration of PAM settings to /usr/lib/pam.d.

OBS-URL: https://build.opensuse.org/request/show/1063688
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:cockpit/cockpit?expand=0&rev=122
This commit is contained in:
Adam Majer 2023-02-10 13:08:12 +00:00 committed by Git OBS Bridge
parent df0626282b
commit 480ac8c5ec
2 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Feb 7 15:47:35 UTC 2023 - Stefan Schubert <schubi@suse.com>
- Migration of PAM settings to /usr/lib/pam.d.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jan 25 11:13:36 UTC 2023 - Luna D Dragon <luna.dragon@suse.com> Wed Jan 25 11:13:36 UTC 2023 - Luna D Dragon <luna.dragon@suse.com>

View File

@ -230,8 +230,13 @@ make -j$(nproc) check
# In obs we get write error: stdout # In obs we get write error: stdout
%make_install | tee make_install.log %make_install | tee make_install.log
make install-tests DESTDIR=%{buildroot} make install-tests DESTDIR=%{buildroot}
%if 0%{?suse_version} > 1500
mkdir -p $RPM_BUILD_ROOT%{_pam_vendordir}
install -p -m 644 tools/cockpit.pam $RPM_BUILD_ROOT%{_pam_vendordir}/cockpit
%else
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -p -m 644 tools/cockpit.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/cockpit install -p -m 644 tools/cockpit.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/cockpit
%endif
rm -f %{buildroot}/%{_libdir}/cockpit/*.so rm -f %{buildroot}/%{_libdir}/cockpit/*.so
install -D -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/cockpit/ install -D -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/cockpit/
@ -322,7 +327,12 @@ done
for libexec in cockpit-askpass cockpit-session cockpit-ws cockpit-tls cockpit-wsinstance-factory cockpit-client cockpit-client.ui cockpit-desktop cockpit-certificate-helper cockpit-certificate-ensure; do for libexec in cockpit-askpass cockpit-session cockpit-ws cockpit-tls cockpit-wsinstance-factory cockpit-client cockpit-client.ui cockpit-desktop cockpit-certificate-helper cockpit-certificate-ensure; do
rm %{buildroot}/%{_libexecdir}/$libexec rm %{buildroot}/%{_libexecdir}/$libexec
done done
rm -r %{buildroot}/%{_libdir}/security %{buildroot}/%{_sysconfdir}/pam.d %{buildroot}/%{_sysconfdir}/motd.d %{buildroot}/%{_sysconfdir}/issue.d rm -r %{buildroot}/%{_libdir}/security %{buildroot}/%{_sysconfdir}/motd.d %{buildroot}/%{_sysconfdir}/issue.d
%if 0%{?suse_version} > 1500
rm -r %{buildroot}/%{_pam_vendordir}
%else
rm -r %{buildroot}/%{_sysconfdir}/pam.d
%endif
rm %{buildroot}/usr/bin/cockpit-bridge rm %{buildroot}/usr/bin/cockpit-bridge
rm -f %{buildroot}%{_libexecdir}/cockpit-ssh rm -f %{buildroot}%{_libexecdir}/cockpit-ssh
rm -f %{buildroot}%{_datadir}/metainfo/cockpit.appdata.xml rm -f %{buildroot}%{_datadir}/metainfo/cockpit.appdata.xml
@ -510,7 +520,11 @@ authentication via sssd/FreeIPA.
%doc %{_mandir}/man8/pam_ssh_add.8.gz %doc %{_mandir}/man8/pam_ssh_add.8.gz
%dir %{_sysconfdir}/cockpit %dir %{_sysconfdir}/cockpit
%config(noreplace) %{_sysconfdir}/cockpit/ws-certs.d %config(noreplace) %{_sysconfdir}/cockpit/ws-certs.d
%if 0%{?suse_version} > 1500
%{_pam_vendordir}/cockpit
%else
%config(noreplace) %{_sysconfdir}/pam.d/cockpit %config(noreplace) %{_sysconfdir}/pam.d/cockpit
%endif
# dir is not owned by pam in openSUSE # dir is not owned by pam in openSUSE
%dir %{_sysconfdir}/motd.d %dir %{_sysconfdir}/motd.d
# created in %post, so that users can rm the files # created in %post, so that users can rm the files
@ -558,6 +572,12 @@ getent passwd cockpit-wsinstance >/dev/null || useradd -r -g cockpit-wsinstance
if %{_sbindir}/selinuxenabled 2>/dev/null; then if %{_sbindir}/selinuxenabled 2>/dev/null; then
%selinux_relabel_pre -s %{selinuxtype} %selinux_relabel_pre -s %{selinuxtype}
fi fi
%if 0%{?suse_version} > 1500
# Prepare for migration to /usr/lib; save any old .rpmsave
for i in pam.d/cockpit ; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
done
%endif
%post ws %post ws
if [ -x %{_sbindir}/selinuxenabled ]; then if [ -x %{_sbindir}/selinuxenabled ]; then
@ -608,6 +628,14 @@ fi
%verify_permissions -e %{_libexecdir}/cockpit-session %verify_permissions -e %{_libexecdir}/cockpit-session
%endif %endif
%if 0%{?suse_version} > 1500
%posttrans ws
# Migration to /usr/lib, restore just created .rpmsave
for i in pam.d/cockpit ; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
done
%endif
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
# Sub-packages that are part of cockpit-system in RHEL/CentOS, but separate in Fedora # Sub-packages that are part of cockpit-system in RHEL/CentOS, but separate in Fedora