From: Brett Neumeier Date: Sun, 29 Jan 2017 14:29:53 +0000 (-0600) Subject: Allow build without sys/capability.h X-Git-Tag: lxc-2.1.0~208^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1400%2Fhead;p=thirdparty%2Flxc.git 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 --- 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;