diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-06-14 10:49:14 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-06-14 10:49:19 +0200 |
commit | fcfcd4cdb1b19fe00f6769f33e6704a7f8700d40 (patch) | |
tree | cf5252f77a52bcd9662e322d69c72a33afdb84e9 /test/e2e | |
parent | 576c739e5ff01c760b383a258c62ed3ca7e1c30c (diff) | |
download | podman-fcfcd4cdb1b19fe00f6769f33e6704a7f8700d40.tar.gz podman-fcfcd4cdb1b19fe00f6769f33e6704a7f8700d40.tar.bz2 podman-fcfcd4cdb1b19fe00f6769f33e6704a7f8700d40.zip |
container: do not create .containerenv with -v SRC:/run
if /run is on a volume do not create the file /run/.containerenv as it
would leak outside of the container.
Closes: https://github.com/containers/podman/issues/14577
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/run_volume_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index 1c0480407..f31e62e42 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -908,6 +908,20 @@ USER testuser`, fedoraMinimal) Expect(session.OutputToString()).To(Equal(perms)) }) + It("podman run with -v $SRC:/run does not create /run/.containerenv", func() { + mountSrc := filepath.Join(podmanTest.TempDir, "vol-test1") + err := os.MkdirAll(mountSrc, 0755) + Expect(err).To(BeNil()) + + session := podmanTest.Podman([]string{"run", "-v", mountSrc + ":/run", ALPINE, "true"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + // the file should not have been created + _, err = os.Stat(filepath.Join(mountSrc, ".containerenv")) + Expect(err).To(Not(BeNil())) + }) + It("podman volume with uid and gid works", func() { volName := "testVol" volCreate := podmanTest.Podman([]string{"volume", "create", "--opt", "o=uid=1000", volName}) |