diff mbox series

[v2] libpam: split /etc/environment into pam-plugin-env package

Message ID 20231127124557.2116286-1-martin@geanix.com
State Accepted, archived
Commit 778fcc8d2e6eb1bd2c88a6abb14dbd6666720205
Headers show
Series [v2] libpam: split /etc/environment into pam-plugin-env package | expand

Commit Message

Martin Hundebøll Nov. 27, 2023, 12:45 p.m. UTC
Since systemd-v255, pam-plugin-umask is pulled in by by the logind
package config for systemd. This causes /etc/environment to be installed
as part of libpam-runtime. In our case, this broke do_rootfs for our
image, because /etc/environment is already provided by another (custom)
recipe.

Fix this by making the /etc/environment file part of the pam-plugin-env
package, which isn't automatically pulled in by systemd-logind. It also
happens to be the where it should be, as the file is installed as part
of the pam_env plugin.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
---

Changes in v2:
 * fixed typos in commit message
 * replaced changes to FILES:${PN}-runtime with prepend=True in
   do_split_packages()

 meta/recipes-extended/pam/libpam_1.5.3.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-extended/pam/libpam_1.5.3.bb b/meta/recipes-extended/pam/libpam_1.5.3.bb
index 1aa307af4d..3183bb018f 100644
--- a/meta/recipes-extended/pam/libpam_1.5.3.bb
+++ b/meta/recipes-extended/pam/libpam_1.5.3.bb
@@ -54,6 +54,11 @@  FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libd
 FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}"
 FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests"
 
+# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is
+# packaged with the pam-plugin-env package to avoid breaking installations which
+# install that file via other packages
+FILES:pam-plugin-env = "${sysconfdir}/environment"
+
 PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
 
 def get_multilib_bit(d):
@@ -110,7 +115,7 @@  python populate_packages:prepend () {
     pam_pkgname = mlprefix + 'pam-plugin%s'
 
     do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname,
-                      'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='')
+                      'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='', prepend=True)
     do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
 }