attach: always drop supplementary groups

Closes #1704. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 5eda487c
......@@ -870,12 +870,12 @@ static int attach_child_main(struct attach_clone_payload *payload)
ret = lxc_switch_uid_gid(new_uid, new_gid);
if (ret < 0)
goto on_error;
ret = lxc_setgroups(0, NULL);
if (ret < 0)
goto on_error;
}
ret = lxc_setgroups(0, NULL);
if (ret < 0)
goto on_error;
if ((init_ctx->container && init_ctx->container->lxc_conf &&
init_ctx->container->lxc_conf->no_new_privs) ||
(options->attach_flags & LXC_ATTACH_NO_NEW_PRIVS)) {
......
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