From 939ff67d15b7db28d67473b1503d1870578a83ca Mon Sep 17 00:00:00 2001 From: Jens Maus Date: Sat, 23 Sep 2023 18:52:14 +0200 Subject: [PATCH] package/nut: package/nut: specify --with-user/group when building NUT This commit fixes a problem where the NUT package couldn't be used as a NUT server due to the fact that the default group for nobody is "nogroup" and not "nobody" like the internal default of NUT. Thus, when starting a NUT server daemon the daemon starts with incorrect group permissions. This commit fixes this shortcoming by introducing a dedicated 'nut' user and 'nut' group to drop priviledges to it. Signed-off-by: Jens Maus Signed-off-by: Yann E. MORIN (cherry picked from commit cd46e1b1439e854dc9e4c016795d6e5276e4c573) Signed-off-by: Peter Korsgaard --- package/nut/nut.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/nut/nut.mk b/package/nut/nut.mk index fb98ba04f0..4c322aeb85 100644 --- a/package/nut/nut.mk +++ b/package/nut/nut.mk @@ -24,7 +24,9 @@ NUT_POST_PATCH_HOOKS += NUT_FIX_CONFIGURE NUT_CONF_OPTS = \ --with-altpidpath=/var/run/upsd \ --with-dev \ - --without-doc + --without-doc \ + --with-user=nut \ + --with-group=nut NUT_CONF_ENV = \ ax_cv_check_cflags__Werror__Wno_unknown_warning_option=no \ @@ -34,6 +36,10 @@ NUT_CONF_ENV = \ ac_cv_func_strncasecmp=yes \ ax_cv__printf_string_null=yes +define NUT_USERS + nut -1 nut -1 * - - - NUT user +endef + ifeq ($(call qstrip,$(BR2_PACKAGE_NUT_DRIVERS)),) NUT_CONF_OPTS += --with-drivers=auto else