From df11e022a50d458c4fe3e97f643293cfc9fd30ff Mon Sep 17 00:00:00 2001 From: Brett Neumeier Date: Sun, 29 Jan 2017 08:29:53 -0600 Subject: [PATCH] Allow build without sys/capability.h There is no guard clause around a reference to CAP_EFFECTIVE and CAP_SETGID, causing compilation to fail if sys/capability.h is not available. Signed-off-by: Brett Neumeier --- src/lxc/start.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lxc/start.c b/src/lxc/start.c index 09dc1ffae..2929514e6 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -898,7 +898,11 @@ static int do_start(void *data) * further above. Only drop groups if we can, so ensure that we * have necessary privilege. */ + #if HAVE_SYS_CAPABILITY_H have_cap_setgid = lxc_cap_is_set(CAP_SETGID, CAP_EFFECTIVE); + #else + have_cap_setgid = false; + #endif if (lxc_list_empty(&handler->conf->id_map) && have_cap_setgid) { if (lxc_setgroups(0, NULL) < 0) goto out_warn_father; -- 2.47.2