Skip to contentSkip to conversation

sudo: fix main executable permissions

PATCH New spdawson at gmail.com 2 participants 3 messages Aug 3, 2012 – Aug 4, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sudo: fix main executable permissions

From: Simon Dawson <[email protected]>

The sudo executable is installed without the setuid bit set, which prevents sudo from working.

This patch adds a post-install hook to fix the permissions of the sudo executable.

---
 package/sudo/sudo.mk |    6 ++++++
 1 file changed, 6 insertions(+)
package/sudo/sudo.mk +6 -0
index 9b0ebed..542edb6 100644
@@ -14,4 +14,10 @@ SUDO_CONF_OPT = \
 		--without-interfaces \
 		--without-pam
 
+define SUDO_FIX_PERMISSIONS
+  chmod 4755 $(TARGET_DIR)/usr/bin/sudo
+endef
+
+SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_FIX_PERMISSIONS
+
 $(eval $(autotools-package))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 sudo: fix main executable permissions

Le Fri, 3 Aug 2012 13:48:31 +0100,
spdawson at gmail.com a ?crit :

package/sudo/sudo.mk SUDO_CONF_OPT = \ · line 21

Quoted 5 lines
package/sudo/sudo.mk +5 -0
+define SUDO_FIX_PERMISSIONS
+  chmod 4755 $(TARGET_DIR)/usr/bin/sudo
+endef
+
+SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_FIX_PERMISSIONS

The principle is good, but not the way it is implemented. Please use the <pkg>_PERMISSIONS infrastructure instead. See the documentation, or package/busybox/busybox.mk for an example.

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 sudo: fix main executable permissions

Quoted 3 lines · Thomas Petazzoni

The principle is good, but not the way it is implemented. Please use the <pkg>_PERMISSIONS infrastructure instead. See the documentation, or package/busybox/busybox.mk for an example.

Okay, thanks Thomas.

Simon.