mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] pam: follow GLOBAL_SELINUX
@ 2026-11-21  9:13 Ladislav Michl
  0 siblings, 0 replies; only message in thread
From: Ladislav Michl @ 2026-11-21  9:13 UTC (permalink / raw)
  To: ptxdist

From: Ladislav Michl <ladis@triops.cz>

Enable SELinux support when the global option is set. This builds
pam_selinux and pam_sepermit, so install sepermit.conf and the
unix_update and pwhistory_helper helpers used by pam_unix and
pam_pwhistory under SELinux.

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 rules/pam.in   | 1 +
 rules/pam.make | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/rules/pam.in b/rules/pam.in
index efc6d95ef..f09ca1193 100644
--- a/rules/pam.in
+++ b/rules/pam.in
@@ -7,6 +7,7 @@ menuconfig PAM
 	select HOST_MESON
 	select LIBC_CRYPT
 	select LIBTIRPC		if PAM_NIS
+	select LIBSELINUX	if GLOBAL_SELINUX
 	help
 	  Linux-PAM (Pluggable Authentication Modules for Linux) is a suite
 	  of shared libraries that enable the local system administrator to
diff --git a/rules/pam.make b/rules/pam.make
index 607750ad5..dc4b7ec62 100644
--- a/rules/pam.make
+++ b/rules/pam.make
@@ -51,7 +51,7 @@ PAM_CONF_OPT	:= \
 	-Dpamlocking=false \
 	-Dpwaccess=disabled \
 	-Dread-both-confs=false \
-	-Dselinux=disabled \
+	-Dselinux=$(call ptx/endis, PTXCONF_GLOBAL_SELINUX)d \
 	-Duidmin=1000 \
 	-Dusergroups=false \
 	-Dxtests=false
@@ -83,7 +83,12 @@ $(STATEDIR)/pam.targetinstall:
 	@$(call install_alternative, pam, 0, 0, 0755, /usr/share/pam/security/namespace.init)
 	@$(call install_alternative, pam, 0, 0, 0644, /usr/share/pam/security/pam_env.conf)
 	@$(call install_alternative, pam, 0, 0, 0644, /usr/share/pam/security/time.conf)
+ifdef PTXCONF_GLOBAL_SELINUX
+	@$(call install_alternative, pam, 0, 0, 0644, /usr/share/pam/security/sepermit.conf)
 
+	@$(call install_copy, pam, 0, 0, 0755, -, /usr/sbin/unix_update)
+	@$(call install_copy, pam, 0, 0, 0755, -, /usr/sbin/pwhistory_helper)
+endif
 	@$(call install_alternative, pam, 0, 0, 0755, /usr/sbin/mkhomedir_helper)
 	@$(call install_alternative, pam, 0, 0, 0755, /usr/sbin/unix_chkpwd)
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-21  9:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-21  9:13 [ptxdist] [PATCH] pam: follow GLOBAL_SELINUX Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox