From: Alexander Mikhalitsyn Date: Wed, 2 Apr 2025 08:45:11 +0000 (+0200) Subject: tools/lxc_attach: fix ENFORCE_MEMFD_REXEC checks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff1ea5099c5f216ba0c3199477b80d5ed626c4f3;p=thirdparty%2Flxc.git tools/lxc_attach: fix ENFORCE_MEMFD_REXEC checks We unconditionally define ENFORCE_MEMFD_REXEC in meson.build to a corresponding boolean value, so we need to use #if instead of #ifdef in the code. Signed-off-by: Alexander Mikhalitsyn --- diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c index a76877dc2..d63c962d0 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -21,7 +21,7 @@ #include "caps.h" #include "confile.h" #include "log.h" -#ifdef ENFORCE_MEMFD_REXEC +#if ENFORCE_MEMFD_REXEC #include "rexec.h" #endif #include "utils.h" @@ -35,7 +35,7 @@ lxc_log_define(lxc_attach, lxc); * container are in the same user namespace or have set up an identity id * mapping: CVE-2019-5736. */ -#ifdef ENFORCE_MEMFD_REXEC +#if ENFORCE_MEMFD_REXEC __attribute__((constructor)) static void lxc_attach_rexec(void) { if (!getenv("LXC_MEMFD_REXEC") && lxc_rexec("lxc-attach")) {