package/util-linux: revert logic regarding pam_selinux module
authorCarlos Santos <unixmania@gmail.com>
Sat, 14 Sep 2019 17:09:22 +0000 (14:09 -0300)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 21 Sep 2019 11:47:10 +0000 (13:47 +0200)
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 cosmetic change prevents leaving a misleading commented-out line
that references a PAM module that does not exist.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/util-linux/su.pam
package/util-linux/util-linux.mk

index 84b18605ce3ba931435734417adc7bdb83731fab..69b2a40c45810ff3dfd0f07495187d495cfeddb8 100644 (file)
@@ -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
index 6daca6b5e6bd3b31b3391b909a9c610a939049e3..ecc3ab62de4ff8032936ed176bb72b8c14bbb559 100644 (file)
@@ -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