[Buildroot] [git commit branch/2022.02.x] packages/sudo: explicitly set with-tzdir

Peter Korsgaard peter at korsgaard.com
Tue Nov 15 12:55:29 UTC 2022


commit: https://git.buildroot.net/buildroot/commit/?id=2a6da8d48660027c48a007394b10369e277b3741
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2022.02.x

sudo's configure script looks up on the host to determine the path to
the timezone data location. That fails in cross-compilation.

This is used to sanitise the TZ envirnment variable at runtime, and is
not used at buildtime (except to be stored as a string in the program).

We can tell sudo where the tz data will be, which we do when the tzdata
package is enabled, and we can tell it not to use it at all (to not pass
TZ down to sudo-ed executions) othwerwise.

Signed-off-by: Nuno Gonçalves <nunog at fr24.com>
[yann.morin.1998 at free.fr: rewrite and extend commit log]
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit 51d3902af72d74cf5bf7c1246e4bf41cfc5e55f3)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/sudo/sudo.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/sudo/sudo.mk b/package/sudo/sudo.mk
index 54901943cd..67af546cfc 100644
--- a/package/sudo/sudo.mk
+++ b/package/sudo/sudo.mk
@@ -16,6 +16,7 @@ SUDO_SELINUX_MODULES = sudo
 # This is to avoid sudo's make install from chown()ing files which fails
 SUDO_INSTALL_TARGET_OPTS = INSTALL_OWNER="" DESTDIR="$(TARGET_DIR)" install
 SUDO_CONF_OPTS = \
+	--with-tzdir=$(if $(BR2_PACKAGE_TZDATA),/usr/share/zoneinfo,no) \
 	--without-lecture \
 	--without-sendmail \
 	--without-umask \



More information about the buildroot mailing list