[OE-core] [PATCH 1/1] util-linux: add runuser PAM config files

Shan Hai shan.hai at windriver.com
Fri May 15 05:29:43 UTC 2015


The runuser command fails with below error message, add proper PAM
config files to fix the problem. The config files are borrowed from
CentOS 7.0 release.

runuser: Failure setting user credentials

Signed-off-by: Shan Hai <shan.hai at windriver.com>
---
 meta/recipes-core/util-linux/util-linux.inc            | 6 ++++++
 meta/recipes-core/util-linux/util-linux/runuser-l.pamd | 4 ++++
 meta/recipes-core/util-linux/util-linux/runuser.pamd   | 5 +++++
 meta/recipes-core/util-linux/util-linux_2.26.1.bb      | 2 ++
 4 files changed, 17 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/runuser-l.pamd
 create mode 100644 meta/recipes-core/util-linux/util-linux/runuser.pamd

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 60309a5..0098fc4 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -163,6 +163,12 @@ do_install () {
 	echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
 
 	rm -f ${D}${bindir}/chkdupexe
+
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+		install -d ${D}${sysconfdir}/pam.d
+		install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser
+		install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l
+	fi
 }
 
 # reset and nologin causes a conflict with ncurses-native and shadow-native
diff --git a/meta/recipes-core/util-linux/util-linux/runuser-l.pamd b/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
new file mode 100644
index 0000000..fa1e4d8
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
@@ -0,0 +1,4 @@
+#%PAM-1.0
+auth		include		runuser
+session		optional	pam_keyinit.so force revoke
+session		include		runuser
diff --git a/meta/recipes-core/util-linux/util-linux/runuser.pamd b/meta/recipes-core/util-linux/util-linux/runuser.pamd
new file mode 100644
index 0000000..37f0e84
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/runuser.pamd
@@ -0,0 +1,5 @@
+#%PAM-1.0
+auth		sufficient	pam_rootok.so
+session		optional	pam_keyinit.so revoke
+session		required	pam_limits.so
+session		required	pam_unix.so
diff --git a/meta/recipes-core/util-linux/util-linux_2.26.1.bb b/meta/recipes-core/util-linux/util-linux_2.26.1.bb
index 58bc90d..2938e0b 100644
--- a/meta/recipes-core/util-linux/util-linux_2.26.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.26.1.bb
@@ -14,6 +14,8 @@ SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
             file://configure-sbindir.patch \
             file://fix-parallel-build.patch \
             ${OLDHOST} \
+            file://runuser.pamd \
+            file://runuser-l.pamd \
 "
 SRC_URI[md5sum] = "2308850946766677f3fabe0685e85de8"
 SRC_URI[sha256sum] = "22dc1c957262e2cbdfb4d524a63d5cd4f219d3ac9b5eab570fc771076799bb6e"
-- 
1.8.5.2.233.g932f7e4




More information about the Openembedded-core mailing list