From 4ef1453b458ea9a9cad0b780d44686a93d620f686251dd1d19ec47ad1b95efc7 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 30 Dec 2022 11:59:00 +0000 Subject: [PATCH] Accepting request 1045606 from home:schubi2:pam_usr_etc - Migration of PAM settings to /usr/lib/pam.d. OBS-URL: https://build.opensuse.org/request/show/1045606 OBS-URL: https://build.opensuse.org/package/show/Virtualization:VMware/open-vm-tools?expand=0&rev=426 --- open-vm-tools.changes | 5 +++++ open-vm-tools.spec | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/open-vm-tools.changes b/open-vm-tools.changes index 178fd16..7cdd9f8 100644 --- a/open-vm-tools.changes +++ b/open-vm-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 28 08:18:43 UTC 2022 - Stefan Schubert + +- Migration of PAM settings to /usr/lib/pam.d. + ------------------------------------------------------------------- Wed Dec 14 21:24:00 UTC 2022 - Kirk Allan diff --git a/open-vm-tools.spec b/open-vm-tools.spec index cedc10c..163424e 100644 --- a/open-vm-tools.spec +++ b/open-vm-tools.spec @@ -311,6 +311,10 @@ mkdir -p %{buildroot}%{_sbindir} # Remove exec bit from config files chmod a-x %{buildroot}%{_sysconfdir}/pam.d/* +%if 0%{?suse_version} > 1500 +install -d %{buildroot}%{_pam_vendordir} +mv %{buildroot}%{_sysconfdir}/pam.d/vmtoolsd %{buildroot}%{_pam_vendordir} +%endif # Remove unnecessary files from packaging find %{buildroot}%{_libdir} -name '*.la' -delete @@ -364,6 +368,18 @@ install -D -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/modprobe.d/50-vmnics.co %service_add_pre vmtoolsd.service %service_add_pre vgauthd.service %service_add_pre vmblock-fuse.service +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in pam.d/vmtoolsd ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done + +%posttrans +# Migration to /usr/etc, restore just created .rpmsave +for i in pam.d/vmtoolsd ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %post /sbin/ldconfig @@ -475,7 +491,11 @@ systemctl try-restart vmtoolsd.service || : %{_bindir}/vmware-xferlogs %{_bindir}/vm-support %{_bindir}/vmware-alias-import +%if 0%{?suse_version} > 1500 +%{_pam_vendordir}/vmtoolsd +%else %config(noreplace) %{_sysconfdir}/pam.d/vmtoolsd +%endif %dir %{_sysconfdir}/vmware-tools %dir %{_sysconfdir}/vmware-tools/scripts %dir %{_sysconfdir}/vmware-tools/scripts/vmware