From ad7c6102f2098c3dc8233e4590ac47753dc4900d Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Fri, 18 Oct 2019 08:31:30 -0300 Subject: [PATCH] busybox: fix missing install with suid bit set if FEATURE_SUID=y MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit With FEATURE_SUID=y one can install busybox binary belonging to root with the suid bit set, enabling some applets to perform root-level operations even when run by ordinary users. Busybox then drops privileges for applets that don't need root access, before entering their main() function. Currently we don't install busybox binary with suid bit set, rendering this feature unusable. Note that we can't just "chmod u+s /bin/busybox" at runtime as a "cheaper" solution: it would waste approximately 200KiB of FLASH (the whole /bin/busybox binary gets copied into the overlay). Ref: PR#2502 Signed-off-by: Henrique de Moraes Holschuh [commit title/description facelift, use INSTALL_SUID variable] Signed-off-by: Petr Å tetiar --- package/utils/busybox/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 1e1712fe71..1046d68d3e 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -113,6 +113,9 @@ endif ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_NTPD),) $(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd $(INSTALL_BIN) ./files/ntpd-hotplug $(1)/usr/sbin/ntpd-hotplug +endif +ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SUID),) + $(INSTALL_SUID) $(PKG_INSTALL_DIR)/bin/busybox $(1)/bin/busybox endif -rm -rf $(1)/lib64 endef -- 2.30.2