summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/commands-fix-check-for-seccomp-notify-support.patch
blob: 391af381eef8d3fbdb75160c71a1c73d4fbe3c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From a342b11fedb3010630de4909ca707ebdc0862060 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Fri, 25 Dec 2020 13:54:14 -0300
Subject: [PATCH] commands: fix check for seccomp notify support

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.

Upstream-status: submitted https://github.com/lxc/lxc/pull/3623

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
---
 src/lxc/commands.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/commands.c b/src/lxc/commands.c
index a9a03ca2c..37d1abcef 100644
--- a/src/lxc/commands.c
+++ b/src/lxc/commands.c
@@ -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,
 	};
-- 
2.17.1