Skip to content

Commit

Permalink
API: libpod/create use correct default umask
Browse files Browse the repository at this point in the history
Make sure containers created via API have the correct umask from
containers.conf set.

Fixes containers#15036

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Jul 22, 2022
1 parent 99bf6f9 commit 5a80770
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/api/handlers/libpod/containers_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion test/apiv2/20-containers.at
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a80770

Please sign in to comment.