[oe-commits] [openembedded-core] 02/12: sudo: add PACKAGECONFIG for pam-wheel

git at git.openembedded.org git at git.openembedded.org
Thu Aug 2 09:23:52 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 7a46ca79b18527a56de470fcaaf95c870c097cf6
Author: Yi Zhao <yi.zhao at windriver.com>
AuthorDate: Wed Aug 1 14:46:38 2018 +0800

    sudo: add PACKAGECONFIG for pam-wheel
    
    The pam_wheel PAM module is used to enforce the so-called wheel group.
    By default it permits root access to the system if the applicant user is
    a member of the wheel group.
    Add PACKAGECONFIG to enable pam_wheel module for sudo.
    
    Signed-off-by: Yi Zhao <yi.zhao at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-extended/sudo/sudo.inc       | 1 +
 meta/recipes-extended/sudo/sudo_1.8.23.bb | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/meta/recipes-extended/sudo/sudo.inc b/meta/recipes-extended/sudo/sudo.inc
index 6e57669..69dccde 100644
--- a/meta/recipes-extended/sudo/sudo.inc
+++ b/meta/recipes-extended/sudo/sudo.inc
@@ -19,6 +19,7 @@ inherit autotools
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
+PACKAGECONFIG[pam-wheel] = ",,,pam-plugin-wheel"
 
 CONFFILES_${PN} = "${sysconfdir}/sudoers"
 
diff --git a/meta/recipes-extended/sudo/sudo_1.8.23.bb b/meta/recipes-extended/sudo/sudo_1.8.23.bb
index 9756fe2..ab9c8cb 100644
--- a/meta/recipes-extended/sudo/sudo_1.8.23.bb
+++ b/meta/recipes-extended/sudo/sudo_1.8.23.bb
@@ -22,6 +22,10 @@ EXTRA_OECONF += " \
 do_install_append () {
 	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
 		install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
+		if ${@bb.utils.contains('PACKAGECONFIG', 'pam-wheel', 'true', 'false', d)} ; then
+			echo 'auth       required     pam_wheel.so use_uid' >>${D}${sysconfdir}/pam.d/sudo
+			sed -i 's/# \(%wheel ALL=(ALL) ALL\)/\1/' ${D}${sysconfdir}/sudoers
+		fi
 	fi
 
 	chmod 4111 ${D}${bindir}/sudo

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list