diff options
author | Ashley Cui <acui@redhat.com> | 2020-07-16 21:49:47 -0400 |
---|---|---|
committer | Ashley Cui <acui@redhat.com> | 2020-07-21 14:22:30 -0400 |
commit | d4d3fbc155419f4017064a65e718ad78d50115cc (patch) | |
tree | 4f73ccfa606a6f8a0d4de07749ce2323687b870d /libpod/container_inspect.go | |
parent | df6920aa79073b2767d24c6524367384b6284b31 (diff) | |
download | podman-d4d3fbc155419f4017064a65e718ad78d50115cc.tar.gz podman-d4d3fbc155419f4017064a65e718ad78d50115cc.tar.bz2 podman-d4d3fbc155419f4017064a65e718ad78d50115cc.zip |
Add --umask flag for create, run
--umask sets the umask inside the container
Defaults to 0022
Co-authored-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r-- | libpod/container_inspect.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 680776dba..a0d223c8c 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -325,6 +325,14 @@ func (c *Container) generateInspectContainerConfig(spec *spec.Spec) *define.Insp ctrConfig.Timezone = c.config.Timezone + // Pad Umask to 4 characters + if len(c.config.Umask) < 4 { + pad := strings.Repeat("0", 4-len(c.config.Umask)) + ctrConfig.Umask = pad + c.config.Umask + } else { + ctrConfig.Umask = c.config.Umask + } + return ctrConfig } |