Skip to content

Commit

Permalink
Fix handling of auth.json file while in a user namespace
Browse files Browse the repository at this point in the history
If you are running buildah within a user namespace, without
XDG_RUNTIME_DIR being set, we need to make sure buildah login, logout
handle XDG_RUNTIME_DIR the same was as buildah push.

Running buildah within a container is triggering failures, where buildah
login puts the auth.json file in /run/containers/0/auth.json but buildah
push looks for it in
/tmp/container-user-0/containers/containers/auth.json

Fixes: containers#3259

[NO TESTS NEEDED] The existing tests should see if this causes any
problems.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jun 2, 2021
1 parent 5e3515c commit 8633515
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/buildah/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func before(cmd *cobra.Command) error {
}

switch cmd.Use {
case "", "help", "version", "mount", "login", "logout":
case "", "help", "version", "mount":
return nil
}
unshare.MaybeReexecUsingUserNamespace(false)
Expand Down

0 comments on commit 8633515

Please sign in to comment.