Commit e06155c9 by Patrick Toomey

Do not switch to root for lxc-execute

parent 814d049d
......@@ -664,9 +664,10 @@ static int do_start(void *data)
/*
* if we are in a new user namespace, become root there to have
* privilege over our namespace
* privilege over our namespace. We don't become root for lxc-execute, as
* the intent is to execute a command as the original user.
*/
if (!lxc_list_empty(&handler->conf->id_map)) {
if (!handler->conf->is_execute && !lxc_list_empty(&handler->conf->id_map)) {
NOTICE("switching to gid/uid 0 in new user namespace");
if (setgid(0)) {
SYSERROR("setgid");
......
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