summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-07-22 14:16:25 +0200
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 14:39:39 -0400
commitc4616510a2c7509be20120353e539804b161922d (patch)
tree07ef7ff907f589cce389acf8245f1c132a8e5b3e
parentce8b6cebdee31536d2f3506876202efac43d1a54 (diff)
downloadpodman-c4616510a2c7509be20120353e539804b161922d.tar.gz
podman-c4616510a2c7509be20120353e539804b161922d.tar.bz2
podman-c4616510a2c7509be20120353e539804b161922d.zip
API: libpod/create use correct default umask
Make sure containers created via API have the correct umask from containers.conf set. Fixes #15036 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r--pkg/api/handlers/libpod/containers_create.go3
-rw-r--r--test/apiv2/20-containers.at3
2 files changed, 5 insertions, 1 deletions
diff --git a/pkg/api/handlers/libpod/containers_create.go b/pkg/api/handlers/libpod/containers_create.go
index e4964d602..1307c267a 100644
--- a/pkg/api/handlers/libpod/containers_create.go
+++ b/pkg/api/handlers/libpod/containers_create.go
@@ -31,6 +31,9 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
ContainerNetworkConfig: specgen.ContainerNetworkConfig{
UseImageHosts: conf.Containers.NoHosts,
},
+ ContainerSecurityConfig: specgen.ContainerSecurityConfig{
+ Umask: conf.Containers.Umask,
+ },
}
if err := json.NewDecoder(r.Body).Decode(&sg); err != nil {
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 6ef4ef917..a8d9baef3 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -123,7 +123,8 @@ t GET libpod/containers/${cid}/json 200 \
.Id=$cid \
.State.Status~\\\(exited\\\|stopped\\\) \
.State.Running=false \
- .State.ExitCode=0
+ .State.ExitCode=0 \
+ .Config.Umask=0022 # regression check for #15036
t DELETE libpod/containers/$cid 200 .[0].Id=$cid
CNAME=myfoo