]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Allow build without sys/capability.h 1399/head 1400/head
authorBrett Neumeier <brett@neumeier.us>
Sun, 29 Jan 2017 14:29:53 +0000 (08:29 -0600)
committerBrett Neumeier <brett@neumeier.us>
Sun, 29 Jan 2017 15:41:20 +0000 (09:41 -0600)
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 <brett@neumeier.us>
src/lxc/start.c

index 09dc1ffaefce6d9ff4584e06545b9b144e9069d5..2929514e672dee35e154317ace4b0e8d0307c2ee 100644 (file)
@@ -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;