Skip to content

Commit

Permalink
Merge pull request #3422 from brauner/2020-05-20/usernsexec_fixes
Browse files Browse the repository at this point in the history
lxc-usernsexec: improvements
  • Loading branch information
stgraber committed May 20, 2020
2 parents 2b5d8a4 + 158d119 commit fbe48de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lxc/cmd/lxc_usernsexec.c
Expand Up @@ -61,7 +61,7 @@ static void opentty(const char *tty, int which)

fd = open(tty, O_RDWR | O_NONBLOCK);
if (fd < 0) {
CMD_SYSERROR("Failed to open tty");
CMD_SYSINFO("Failed to open tty");
return;
}

Expand All @@ -87,11 +87,11 @@ static int do_child(void *vargv)
int ret;
char **argv = (char **)vargv;

/* Assume we want to become root */
if (!lxc_switch_uid_gid(0, 0))
if (!lxc_setgroups(0, NULL))
return -1;

if (!lxc_setgroups(0, NULL))
/* Assume we want to become root */
if (!lxc_switch_uid_gid(0, 0))
return -1;

ret = unshare(CLONE_NEWNS);
Expand Down

0 comments on commit fbe48de

Please sign in to comment.