Skip to contentSkip to conversation

package/util-linux: revert logic regarding pam_selinux module

PATCH New unixmania at gmail.com 3 participants 4 messages Sep 14, 2019 – Sep 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/util-linux: revert logic regarding pam_selinux module

From: Carlos Santos <[email protected]>

Leave pam_selinux enabled by default in su.pam and remove it from the /etc/pam.d/su and /etc/pam.d/su-l files if libselinux is not selected.

This prevents leaving a misleading line, even commented, referencing a PAM module that does not exist.

---
 package/util-linux/su.pam        | 4 ++--
 package/util-linux/util-linux.mk | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
package/util-linux/su.pam +2 -2
index 84b18605ce..69b2a40c45 100644
@@ -7,9 +7,9 @@ account		required	pam_unix.so
 
 password	required	pam_unix.so nullok
 
-# session	required	pam_selinux.so close
+session		required	pam_selinux.so close
 session		required	pam_limits.so
 session		required	pam_env.so
 session		required	pam_unix.so
 session		optional	pam_lastlog.so
-# session	required	pam_selinux.so open
+session		required	pam_selinux.so open
package/util-linux/util-linux.mk +3 -3
index cd69838046..35f9fc16ac 100644
@@ -75,14 +75,14 @@ UTIL_LINUX_MAKE_OPTS += LIBS="$(UTIL_LINUX_LIBS)"
 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 UTIL_LINUX_DEPENDENCIES += libselinux
 UTIL_LINUX_CONF_OPTS += --with-selinux
+else
+UTIL_LINUX_CONF_OPTS += --without-selinux
 define UTIL_LINUX_SELINUX_PAMFILES_TWEAK
 	$(foreach f,su su-l,
-		$(SED) 's/^# \(.*pam_selinux.so.*\)$$/\1/' \
+		$(SED) '/^.*pam_selinux.so.*$$/d' \
 			$(TARGET_DIR)/etc/pam.d/$(f)
 	)
 endef
-else
-UTIL_LINUX_CONF_OPTS += --without-selinux
 endif
 
 # Used by cramfs utils
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 package/util-linux: revert logic regarding pam_selinux module

Hello Carlos,

Quoted 7 lines · On Sat, 14 Sep 2019 14:09:22 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

Leave pam_selinux enabled by default in su.pam and remove it from the /etc/pam.d/su and /etc/pam.d/su-l files if libselinux is not selected.

This prevents leaving a misleading line, even commented, referencing a PAM module that does not exist.

Just to make sure I understand: the motivation for this patch is just to avoid the pam_selinux.so lines that remain present (but commented) in the file when SELinux support is disabled ?

I.e, it is just cosmetic, but functional, correct ?

(This is not a criticism of the proposal, just an attempt to make sure I'm not missing the point.)

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/util-linux: revert logic regarding pam_selinux module

Quoted 18 lines · Thomas Petazzoni

Hello Carlos,

Quoted 7 lines · On Sat, 14 Sep 2019 14:09:22 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

Leave pam_selinux enabled by default in su.pam and remove it from the /etc/pam.d/su and /etc/pam.d/su-l files if libselinux is not selected.

This prevents leaving a misleading line, even commented, referencing a PAM module that does not exist.

Just to make sure I understand: the motivation for this patch is just to avoid the pam_selinux.so lines that remain present (but commented) in the file when SELinux support is disabled ?

Quoted 6 lines

I.e, it is just cosmetic, but functional, correct ?

(This is not a criticism of the proposal, just an attempt to make sure I'm not missing the point.)

Thanks!

Yes, It's just to ensure that the configuration file reflects the system configuration.

Signature · 1 line
Carlos Santos <[email protected]>
#3 lore raw

PATCH 1/1 package/util-linux: revert logic regarding pam_selinux module

In reply to unixmania at gmail.com
Quoted 7 lines · unixmania at gmail.com

From: Carlos Santos <[email protected]>

Leave pam_selinux enabled by default in su.pam and remove it from the /etc/pam.d/su and /etc/pam.d/su-l files if libselinux is not selected.

This prevents leaving a misleading line, even commented, referencing a PAM module that does not exist.

I've slightly reworded this and committed to master, thanks.

Regards,
Arnout

Quoted 46 lines
---
 package/util-linux/su.pam        | 4 ++--
 package/util-linux/util-linux.mk | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
package/util-linux/su.pam +2 -2
index 84b18605ce..69b2a40c45 100644
@@ -7,9 +7,9 @@ account		required	pam_unix.so
 
 password	required	pam_unix.so nullok
 
-# session	required	pam_selinux.so close
+session		required	pam_selinux.so close
 session		required	pam_limits.so
 session		required	pam_env.so
 session		required	pam_unix.so
 session		optional	pam_lastlog.so
-# session	required	pam_selinux.so open
+session		required	pam_selinux.so open
package/util-linux/util-linux.mk +3 -3
index cd69838046..35f9fc16ac 100644
@@ -75,14 +75,14 @@ UTIL_LINUX_MAKE_OPTS += LIBS="$(UTIL_LINUX_LIBS)"
 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 UTIL_LINUX_DEPENDENCIES += libselinux
 UTIL_LINUX_CONF_OPTS += --with-selinux
+else
+UTIL_LINUX_CONF_OPTS += --without-selinux
 define UTIL_LINUX_SELINUX_PAMFILES_TWEAK
 	$(foreach f,su su-l,
-		$(SED) 's/^# \(.*pam_selinux.so.*\)$$/\1/' \
+		$(SED) '/^.*pam_selinux.so.*$$/d' \
 			$(TARGET_DIR)/etc/pam.d/$(f)
 	)
 endef
-else
-UTIL_LINUX_CONF_OPTS += --without-selinux
 endif
 
 # Used by cramfs utils