* [ptxdist] [PATCH] util-linux: add option for building setpriv
@ 2025-11-27 7:41 Holger Assmann
0 siblings, 0 replies; only message in thread
From: Holger Assmann @ 2025-11-27 7:41 UTC (permalink / raw)
To: ptxdist; +Cc: Holger Assmann
The util-linux implementation of setpriv vastly differs from the one
already provided by busybox: Whilst the latter one only provides
functionality to act on certain Linux capabilities, the version by
util-linux also allows for more sophisticated operations like UID/GID
management or environment handling.
Signed-off-by: Holger Assmann <h.assmann@pengutronix.de>
---
rules/util-linux.in | 11 +++++++++++
rules/util-linux.make | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/rules/util-linux.in b/rules/util-linux.in
index 6ff817997..5f7fbd269 100644
--- a/rules/util-linux.in
+++ b/rules/util-linux.in
@@ -5,6 +5,7 @@ menuconfig UTIL_LINUX
prompt "util-linux "
select GCCLIBS_GCC_S
select LIBC_CRYPT if UTIL_LINUX_SULOGIN
+ select LIBCAP_NG if UTIL_LINUX_SETPRIV
select HOST_MESON
select UTIL_LINUX_LIBBLKID
select UTIL_LINUX_LIBUUID if UTIL_LINUX_MKSWAP_UUID
@@ -555,6 +556,16 @@ config UTIL_LINUX_SWAPON
comment "BusyBox' swapon is selected!"
depends on BUSYBOX_SWAPON
+config UTIL_LINUX_SETPRIV
+ bool
+ depends on !BUSYBOX_SETPRIV
+ prompt "setpriv"
+ help
+ Run a program with different Linux privilege settings.
+
+comment "BusyBox' setpriv is selected!"
+ depends on BUSYBOX_SETPRIV
+
config UTIL_LINUX_SETSID
bool
depends on !BUSYBOX_SETSID
diff --git a/rules/util-linux.make b/rules/util-linux.make
index bcf36b195..9e7f0f2f0 100644
--- a/rules/util-linux.make
+++ b/rules/util-linux.make
@@ -143,7 +143,7 @@ UTIL_LINUX_CONF_OPT := \
-Dbuild-script=disabled \
-Dbuild-scriptutils=disabled \
-Dbuild-setarch=disabled \
- -Dbuild-setpriv=disabled \
+ -Dbuild-setpriv=$(call ptx/endis, PTXCONF_UTIL_LINUX_SETPRIV)d \
-Dbuild-setterm=$(call ptx/endis, PTXCONF_UTIL_LINUX_SETTERM)d \
-Dbuild-su=disabled \
-Dbuild-sulogin=$(call ptx/endis, PTXCONF_UTIL_LINUX_SULOGIN)d \
@@ -271,6 +271,7 @@ UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_READPROFILE) += sbin/readprofile
UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_RFKILL) += sbin/rfkill
UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_SWAPON) += sbin/swapoff sbin/swapon
UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_PIPESZ) += bin/pipesz
+UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_SETPRIV) += bin/setpriv
UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_SETSID) += bin/setsid
UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_SWITCH_ROOT) += sbin/switch_root
UTIL_LINUX_BIN-$(PTXCONF_UTIL_LINUX_UMOUNT) += bin/umount
--
2.47.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-27 7:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-27 7:41 [ptxdist] [PATCH] util-linux: add option for building setpriv Holger Assmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox