From ff1ea5099c5f216ba0c3199477b80d5ed626c4f3 Mon Sep 17 00:00:00 2001 From: Alexander Mikhalitsyn Date: Wed, 2 Apr 2025 10:45:11 +0200 Subject: [PATCH] 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 --- src/lxc/tools/lxc_attach.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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")) { -- 2.47.3