mirror of
https://github.com/containers/podman.git
synced 2025-12-12 17:57:31 +08:00
Setup HOME environment when using --userns=keep-id
Currently the HOME environment is set to /root if the user does not override it. Also walk the parent directories of users homedir to see if it is volume mounted into the container, if yes, then set it correctly. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
committed by
Ed Santiago
parent
e4f6a1afae
commit
1814bac92e
@@ -365,4 +365,16 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
||||
})
|
||||
|
||||
It("podman run --userns=keep-id check $HOME", func() {
|
||||
var session *PodmanSessionIntegration
|
||||
|
||||
currentUser, err := user.Current()
|
||||
Expect(err).To(BeNil())
|
||||
session = podmanTest.Podman([]string{"run", "-v", fmt.Sprintf("%s:%s", currentUser.HomeDir, currentUser.HomeDir), "--userns=keep-id", fedoraToolbox, "sh", "-c", "echo $HOME"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring(currentUser.HomeDir))
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user