mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
pkg/api: do not leak config pointers into specgen
The value of the pointer might be changed while creating the container causing unexpected side effects. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -86,4 +86,17 @@ podman run $IMAGE true
|
||||
t POST libpod/containers/prune 200
|
||||
t GET libpod/containers/json 200 \
|
||||
length=0
|
||||
|
||||
# check the config options are not overwritten by acceident
|
||||
t POST libpod/containers/create name=test1 image=$IMAGE privileged=true 201
|
||||
t GET libpod/containers/test1/json 200 \
|
||||
.HostConfig.Annotations.'"io.podman.annotations.privileged"'="TRUE"
|
||||
|
||||
# now the same without privileged it should not inhert the privileged from before
|
||||
t POST libpod/containers/create name=test2 image=$IMAGE 201
|
||||
t GET libpod/containers/test2/json 200 \
|
||||
.HostConfig.Annotations=null
|
||||
|
||||
podman rm test1 test2
|
||||
|
||||
# vim: filetype=sh
|
||||
|
||||
Reference in New Issue
Block a user