Unverified Commit 00a7a301 by Brett Neumeier Committed by Stéphane Graber

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: 's avatarBrett Neumeier <brett@neumeier.us>
parent 44050f3e
...@@ -873,7 +873,11 @@ static int do_start(void *data) ...@@ -873,7 +873,11 @@ static int do_start(void *data)
* further above. Only drop groups if we can, so ensure that we * further above. Only drop groups if we can, so ensure that we
* have necessary privilege. * have necessary privilege.
*/ */
#if HAVE_SYS_CAPABILITY_H
have_cap_setgid = lxc_cap_is_set(CAP_SETGID, CAP_EFFECTIVE); 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_list_empty(&handler->conf->id_map) && have_cap_setgid) {
if (lxc_setgroups(0, NULL) < 0) if (lxc_setgroups(0, NULL) < 0)
goto out_warn_father; goto out_warn_father;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment