Patchwork [07/10] sudo: add pam support

login
register
mail settings
Submitter Kang Kai
Date July 21, 2011, 8 a.m.
Message ID <32d1cb41db60871d067df99d7b24b46a3fe8297e.1311234759.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/8199/
State New, archived
Headers show

Comments

Kang Kai - July 21, 2011, 8 a.m.
From: Kang Kai <kai.kang@windriver.com>

According to DISTRO_FEATURES to add pam support for sudo, and import
configure file from Fedora.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 meta/recipes-extended/sudo/files/sudo.pamd |    6 ++++++
 meta/recipes-extended/sudo/sudo_1.8.1p2.bb |   11 ++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-extended/sudo/files/sudo.pamd
Phil Blundell - July 21, 2011, 9:06 a.m.
On Thu, 2011-07-21 at 16:00 +0800, Kang Kai wrote:
> +do_install_append () {
> +	install -D -m 664 ${WORKDIR}/sudo.pamd ${D}/${sysconfdir}/pam.d/sudo
> +}

As with openssh, you don't want to install and ship this file if pam
isn't enabled.

p.
Kang Kai - July 21, 2011, 9:42 a.m.
On 2011?07?21? 17:06, Phil Blundell wrote:
> On Thu, 2011-07-21 at 16:00 +0800, Kang Kai wrote:
>> +do_install_append () {
>> +	install -D -m 664 ${WORKDIR}/sudo.pamd ${D}/${sysconfdir}/pam.d/sudo
>> +}
> As with openssh, you don't want to install and ship this file if pam
> isn't enabled.
>
> p.

ok, we'll try to do that.

Thanks,
Kai
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-extended/sudo/files/sudo.pamd b/meta/recipes-extended/sudo/files/sudo.pamd
new file mode 100644
index 0000000..5bc26e7
--- /dev/null
+++ b/meta/recipes-extended/sudo/files/sudo.pamd
@@ -0,0 +1,6 @@ 
+#%PAM-1.0
+auth       include      common-auth
+account    include      common-account
+password   include      common-password
+session    required     pam_keyinit.so revoke
+session    required     pam_limits.so
diff --git a/meta/recipes-extended/sudo/sudo_1.8.1p2.bb b/meta/recipes-extended/sudo/sudo_1.8.1p2.bb
index 7eba307..529a44b 100644
--- a/meta/recipes-extended/sudo/sudo_1.8.1p2.bb
+++ b/meta/recipes-extended/sudo/sudo_1.8.1p2.bb
@@ -1,11 +1,16 @@ 
 require sudo.inc
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
-           file://libtool.patch"
+           file://libtool.patch \
+           file://sudo.pamd"
 
 SRC_URI[md5sum] = "e8330f0e63b0ecb2e12b5c76922818cc"
 SRC_URI[sha256sum] = "281f90c80547cf22132e351e7f61c25ba4ba9cf393438468f318f9a7884026fb"
 
-EXTRA_OECONF += " --with-pam=no"
+EXTRA_OECONF += " ${@base_contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)}"
+
+do_install_append () {
+	install -D -m 664 ${WORKDIR}/sudo.pamd ${D}/${sysconfdir}/pam.d/sudo
+}