]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands: fix check for seccomp notify support
authorEneas U de Queiroz <cotequeiroz@gmail.com>
Fri, 25 Dec 2020 16:54:14 +0000 (13:54 -0300)
committerEneas U de Queiroz <cotequeiroz@gmail.com>
Sat, 16 Jan 2021 16:58:22 +0000 (13:58 -0300)
Use HAVE_SECCOMP_NOTIFY instead of HAVE_DECL_SECCOMP_NOTIFY_FD.
Currently the latter will be true if the declaration is found by
configure, even if 'configure --disable-seccomp' is used.

HAVE_SECCOMP_NOTIFY is defined in lxcseccomp.h if both HAVE_SECCOMP and
HAVE_DECL_SECCOMP_NOTIFY_FD are true, which is the correct behavior.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
src/lxc/commands.c

index a9a03ca2c8e32fae43c2796a1d112b13d4e1ae31..37d1abcefbfa9cb91be14e9bae3704030da702a3 100644 (file)
@@ -501,7 +501,7 @@ static int lxc_cmd_get_devpts_fd_callback(int fd, struct lxc_cmd_req *req,
 
 int lxc_cmd_get_seccomp_notify_fd(const char *name, const char *lxcpath)
 {
-#if HAVE_DECL_SECCOMP_NOTIFY_FD
+#ifdef HAVE_SECCOMP_NOTIFY
        int ret, stopped;
        struct lxc_cmd_rr cmd = {
                .req = {
@@ -526,7 +526,7 @@ static int lxc_cmd_get_seccomp_notify_fd_callback(int fd, struct lxc_cmd_req *re
                                                  struct lxc_handler *handler,
                                                  struct lxc_epoll_descr *descr)
 {
-#if HAVE_DECL_SECCOMP_NOTIFY_FD
+#ifdef HAVE_SECCOMP_NOTIFY
        struct lxc_cmd_rsp rsp = {
                .ret = 0,
        };