Commit 727c3073 by Wesley M Committed by Stéphane Graber

Refactoring conditional directives.

parent ab572367
...@@ -558,6 +558,7 @@ int lxc_read_seccomp_config(struct lxc_conf *conf) ...@@ -558,6 +558,7 @@ int lxc_read_seccomp_config(struct lxc_conf *conf)
{ {
FILE *f; FILE *f;
int ret; int ret;
int check_seccomp_attr_set;
if (!conf->seccomp) if (!conf->seccomp)
return 0; return 0;
...@@ -578,11 +579,12 @@ int lxc_read_seccomp_config(struct lxc_conf *conf) ...@@ -578,11 +579,12 @@ int lxc_read_seccomp_config(struct lxc_conf *conf)
/* turn of no-new-privs. We don't want it in lxc, and it breaks /* turn of no-new-privs. We don't want it in lxc, and it breaks
* with apparmor */ * with apparmor */
if (seccomp_attr_set(
#if HAVE_SCMP_FILTER_CTX #if HAVE_SCMP_FILTER_CTX
conf->seccomp_ctx, check_seccomp_attr_set = seccomp_attr_set(conf->seccomp_ctx, SCMP_FLTATR_CTL_NNP, 0);
#else
check_seccomp_attr_set = seccomp_attr_set(SCMP_FLTATR_CTL_NNP, 0);
#endif #endif
SCMP_FLTATR_CTL_NNP, 0)) { if (check_seccomp_attr_set) {
ERROR("failed to turn off n-new-privs"); ERROR("failed to turn off n-new-privs");
return -1; return -1;
} }
......
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