summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2013-11-28 17:22:27 (GMT)
committer Peter Korsgaard <peter@korsgaard.com>2013-12-03 08:05:10 (GMT)
commit33e3245e047858cd89223cf5b4afbf4cb32318b0 (patch)
treefdb51c38efdc6aea09e4d9c18e0280da4f0bec08
parent72b3c1db513a6235fd5e5f00fb6c15071ffc6015 (diff)
downloadbuildroot-33e3245e047858cd89223cf5b4afbf4cb32318b0.tar.gz
buildroot-33e3245e047858cd89223cf5b4afbf4cb32318b0.tar.bz2
util-linux: install PAM configuration files
Install PAM configuration files for su (with "su -" variant) and login when the tools are enabled. This finally fixes bug #5366 and now we can login with an util-linux /bin/login. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/util-linux/login.pam11
-rw-r--r--package/util-linux/su.pam13
-rw-r--r--package/util-linux/util-linux.mk14
3 files changed, 38 insertions, 0 deletions
diff --git a/package/util-linux/login.pam b/package/util-linux/login.pam
new file mode 100644
index 0000000..1d9cd70
--- /dev/null
+++ b/package/util-linux/login.pam
@@ -0,0 +1,11 @@
+auth required pam_securetty.so
+auth required pam_unix.so nullok
+
+account required pam_unix.so
+
+password required pam_unix.so nullok
+
+session required pam_limits.so
+session required pam_env.so
+session required pam_unix.so
+session optional pam_lastlog.so
diff --git a/package/util-linux/su.pam b/package/util-linux/su.pam
new file mode 100644
index 0000000..f000c39
--- /dev/null
+++ b/package/util-linux/su.pam
@@ -0,0 +1,13 @@
+auth sufficient pam_rootok.so
+auth required pam_wheel.so use_uid
+auth required pam_env.so
+auth required pam_unix.so nullok
+
+account required pam_unix.so
+
+password required pam_unix.so nullok
+
+session required pam_limits.so
+session required pam_env.so
+session required pam_unix.so
+session optional pam_lastlog.so
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index a694f3d..0925ab3 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -98,6 +98,20 @@ endef
UTIL_LINUX_PRE_PATCH_HOOKS += UTIL_LINUX_DISABLE_TOOLS
endif
+# Install PAM configuration files
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),y)
+define UTIL_LINUX_INSTALL_PAMFILES
+ $(INSTALL) -m 0644 package/util-linux/login.pam \
+ $(TARGET_DIR)/etc/pam.d/login
+ $(INSTALL) -m 0644 package/util-linux/su.pam \
+ $(TARGET_DIR)/etc/pam.d/su
+ $(INSTALL) -m 0644 package/util-linux/su.pam \
+ $(TARGET_DIR)/etc/pam.d/su-l
+endef
+endif
+
+UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
+
$(eval $(autotools-package))
$(eval $(host-autotools-package))