Unverified Commit fbe48de4 by Stéphane Graber Committed by GitHub

Merge pull request #3422 from brauner/2020-05-20/usernsexec_fixes

lxc-usernsexec: improvements
parents 2b5d8a43 158d119f
...@@ -61,7 +61,7 @@ static void opentty(const char *tty, int which) ...@@ -61,7 +61,7 @@ static void opentty(const char *tty, int which)
fd = open(tty, O_RDWR | O_NONBLOCK); fd = open(tty, O_RDWR | O_NONBLOCK);
if (fd < 0) { if (fd < 0) {
CMD_SYSERROR("Failed to open tty"); CMD_SYSINFO("Failed to open tty");
return; return;
} }
...@@ -87,11 +87,11 @@ static int do_child(void *vargv) ...@@ -87,11 +87,11 @@ static int do_child(void *vargv)
int ret; int ret;
char **argv = (char **)vargv; char **argv = (char **)vargv;
/* Assume we want to become root */ if (!lxc_setgroups(0, NULL))
if (!lxc_switch_uid_gid(0, 0))
return -1; return -1;
if (!lxc_setgroups(0, NULL)) /* Assume we want to become root */
if (!lxc_switch_uid_gid(0, 0))
return -1; return -1;
ret = unshare(CLONE_NEWNS); ret = unshare(CLONE_NEWNS);
......
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