mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <oss-lists@triops.cz>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] pam: follow GLOBAL_SELINUX
Date: Sat, 21 Nov 2026 10:13:18 +0100	[thread overview]
Message-ID: <awFgrt88jpgE5eus@lenoch> (raw)

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




                 reply	other threads:[~2026-11-21  9:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awFgrt88jpgE5eus@lenoch \
    --to=oss-lists@triops.cz \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox