attach: cleanup no_new_privs()

parent d4db3d14
...@@ -692,27 +692,26 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options ...@@ -692,27 +692,26 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
static bool no_new_privs(struct lxc_container *c, lxc_attach_options_t *options) static bool no_new_privs(struct lxc_container *c, lxc_attach_options_t *options)
{ {
bool bret;
char *val; char *val;
/* Remove current setting. */ /* Remove current setting. */
if (!c->set_config_item(c, "lxc.no_new_privs", "")) if (!c->set_config_item(c, "lxc.no_new_privs", "")) {
INFO("Failed to unset lxc.no_new_privs");
return false; return false;
}
/* Retrieve currently active setting. */ /* Retrieve currently active setting. */
val = c->get_running_config_item(c, "lxc.no_new_privs"); val = c->get_running_config_item(c, "lxc.no_new_privs");
if (!val) { if (!val) {
INFO("Failed to get running config item for lxc.no_new_privs."); INFO("Failed to retrieve lxc.no_new_privs");
return false; return false;
} }
/* Set currently active setting. */ /* Set currently active setting. */
if (!c->set_config_item(c, "lxc.no_new_privs", val)) { bret = c->set_config_item(c, "lxc.no_new_privs", val);
free(val);
return false;
}
free(val); free(val);
return bret;
return true;
} }
static signed long get_personality(const char *name, const char *lxcpath) static signed long get_personality(const char *name, const char *lxcpath)
......
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