Skip to contentSkip to conversation

sudo: enable pam support

PATCH New James Knight 2 participants 2 messages Jun 19, 2015 – Jun 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sudo: enable pam support

Configure the sudo utility to support PAM if the framework is enabled.

---
 package/sudo/sudo.mk  | 13 ++++++++++++-
 package/sudo/sudo.pam | 12 ++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 package/sudo/sudo.pam
package/sudo/sudo.mk +12 -1
index a1a8328..9fa1cd6 100644
@@ -16,9 +16,20 @@ SUDO_CONF_OPTS = \
 	--without-umask \
 	--with-logging=syslog \
 	--without-interfaces \
-	--without-pam \
 	--with-env-editor
 
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+define SUDO_INSTALL_PAM_CONF
+	$(INSTALL) -m 0644 package/sudo/sudo.pam $(TARGET_DIR)/etc/pam.d/sudo
+endef
+
+SUDO_DEPENDENCIES += linux-pam
+SUDO_CONF_OPTS += --with-pam
+SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_INSTALL_PAM_CONF
+else
+SUDO_CONF_OPTS += --without-pam
+endif
+
 # mksigname/mksiglist needs to run on build host to generate source files
 define SUDO_BUILD_MKSIGNAME_MKSIGLIST_HOST
 	$(MAKE) $(HOST_CONFIGURE_OPTS) \
package/sudo/sudo.pam new file +12 -0
new file mode 100644
index 0000000..c6e6f20
@@ -0,0 +1,12 @@
+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
Signature · 1 line
1.9.5.msysgit.1
#1 lore raw

PATCH 1/1 sudo: enable pam support

Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"James" == James Knight <[email protected]> writes:

Configure the sudo utility to support PAM if the framework is enabled.

---
 package/sudo/sudo.mk  | 13 ++++++++++++-
 package/sudo/sudo.pam | 12 ++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 package/sudo/sudo.pam
package/sudo/sudo.mk +0 -0
index a1a8328..9fa1cd6 100644

package/sudo/sudo.mk SUDO_CONF_OPTS = \ · line 23

Quoted 9 lines
package/sudo/sudo.mk +3 -1
@@ -16,9 +16,20 @@ SUDO_CONF_OPTS = \
 	--without-umask \
 	--with-logging=syslog \
 	--without-interfaces \
-	--without-pam \
 	--with-env-editor
 
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+define SUDO_INSTALL_PAM_CONF
+	$(INSTALL) -m 0644 package/sudo/sudo.pam $(TARGET_DIR)/etc/pam.d/sudo

This should use the -D option to ensure the destination directories gets created. Committed with that fixed, thanks!

Signature · 1 line
Bye, Peter Korsgaard