Skip to content

Commit

Permalink
Merge pull request #3468 from giuseppe/fix-sudo-rootless
Browse files Browse the repository at this point in the history
rootless: do not join namespace if it has already euid == 0
  • Loading branch information
openshift-merge-robot committed Jul 1, 2019
2 parents 1507788 + 4b176d4 commit 3b9ce8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rootless/rootless_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static void __attribute__((constructor)) init()
/* Shortcut. If we are able to join the pause pid file, do it now so we don't
need to re-exec. */
xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR");
if (xdg_runtime_dir && xdg_runtime_dir[0] && can_use_shortcut ())
if (geteuid () != 0 && xdg_runtime_dir && xdg_runtime_dir[0] && can_use_shortcut ())
{
int r;
int fd;
Expand Down

0 comments on commit 3b9ce8a

Please sign in to comment.