mirror of
https://github.com/containers/podman.git
synced 2025-06-23 10:38:20 +08:00
Fix handling of tmpfs-mode for tmpfs creation in compat mode
The permissions on disk were wrong since we were not converting to octal. Fixes: https://github.com/containers/podman/issues/13108 [NO NEW TESTS NEEDED] Since we don't currently test using the docker client Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -117,7 +117,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c
|
||||
case mount.TypeTmpfs:
|
||||
if m.TmpfsOptions != nil {
|
||||
addField(&builder, "tmpfs-size", strconv.FormatInt(m.TmpfsOptions.SizeBytes, 10))
|
||||
addField(&builder, "tmpfs-mode", strconv.FormatUint(uint64(m.TmpfsOptions.Mode), 10))
|
||||
addField(&builder, "tmpfs-mode", strconv.FormatUint(uint64(m.TmpfsOptions.Mode), 8))
|
||||
}
|
||||
case mount.TypeVolume:
|
||||
// All current VolumeOpts are handled above
|
||||
|
@ -394,7 +394,8 @@ t GET containers/$cid/json 200 \
|
||||
.Config.Healthcheck.Retries=3
|
||||
|
||||
# compat api: Test for mount options support
|
||||
payload='{"Mounts":[{"Type":"tmpfs","Target":"/mnt/scratch","TmpfsOptions":{"SizeBytes":1024,"Mode":755}}]}'
|
||||
# Sigh, JSON can't handle octal. 0755(octal) = 493(decimal)
|
||||
payload='{"Mounts":[{"Type":"tmpfs","Target":"/mnt/scratch","TmpfsOptions":{"SizeBytes":1024,"Mode":493}}]}'
|
||||
t POST containers/create Image=$IMAGE HostConfig="$payload" 201 .Id~[0-9a-f]\\{64\\}
|
||||
cid=$(jq -r '.Id' <<<"$output")
|
||||
t GET containers/$cid/json 200 \
|
||||
|
Reference in New Issue
Block a user