From: Andrei Pavel Date: Tue, 17 Jun 2025 09:15:22 +0000 (+0300) Subject: [#3493] Run sudo -k before checking passwordless sudo to make sure sudo is not cached X-Git-Tag: Kea-3.0.0~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ee261768793cb3ed4343421c31561803c4de280;p=thirdparty%2Fkea.git [#3493] Run sudo -k before checking passwordless sudo to make sure sudo is not cached --- diff --git a/meson.build b/meson.build index a7d577e8ca..31be3700ab 100644 --- a/meson.build +++ b/meson.build @@ -129,6 +129,19 @@ ENV = find_program(TOP_SOURCE_DIR / 'scripts/env.sh') GRABBER = find_program(TOP_SOURCE_DIR / 'scripts/grabber.py') KEA_MSG_COMPILER = disabler() +#### sudo + +PASSWORDLESS_SUDO_SET_UP = false +if SUDO.found() + result = run_command(SUDO, '-k', check: false) + if result.returncode() == 0 + result = run_command(SUDO, '-n', 'true', check: false) + if result.returncode() == 0 + PASSWORDLESS_SUDO_SET_UP = true + endif + endif +endif + #### Configuration Data # TODO: Remaining define macros used in code, but not handled by meson: @@ -568,14 +581,6 @@ else endif conf_data.set('PACKAGE_VERSION_TYPE', f'"@package_version_type@"') -PASSWORDLESS_SUDO_SET_UP = false -if SUDO.found() - result = run_command(SUDO, '-n', 'true', check: false) - if result.returncode() == 0 - PASSWORDLESS_SUDO_SET_UP = true - endif -endif - #### Compiler compile_args = []