mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
container: do not chown to dest target with U
if the 'U' option is provided, do not chown the destination target to the existing target in the image. Closes: https://github.com/containers/podman/issues/22224 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -750,6 +750,12 @@ VOLUME /test/`, ALPINE)
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring("888:888"))
|
||||
|
||||
// test with an existing directory in the image
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--user", "881:882", "-v", "NAMED-VOLUME:/mnt:U", ALPINE, "stat", "-c", "%u:%g", "/mnt"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring("881:882"))
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--user", "888:888", "--userns", "auto", "-v", vol, ALPINE, "stat", "-c", "%u:%g", dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
Reference in New Issue
Block a user