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/define | |
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/define')
-rw-r--r-- | libpod/define/config.go | 2 | ||||
-rw-r--r-- | libpod/define/container_inspect.go | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libpod/define/config.go b/libpod/define/config.go index 64b24d9e2..6c426f2ec 100644 --- a/libpod/define/config.go +++ b/libpod/define/config.go @@ -20,6 +20,8 @@ var ( NameRegex = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") // RegexError is thrown in presence of an invalid container/pod name. RegexError = errors.Wrapf(ErrInvalidArg, "names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*") + // UmaskRegex is a regular expression to validate Umask. + UmaskRegex = regexp.MustCompile(`^[0-7]{1,4}$`) ) const ( diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go index fbd9da3e7..a08cb3de6 100644 --- a/libpod/define/container_inspect.go +++ b/libpod/define/container_inspect.go @@ -61,6 +61,8 @@ type InspectContainerConfig struct { // systemd mode, the container configuration is customized to optimize // running systemd in the container. SystemdMode bool `json:"SystemdMode,omitempty"` + // Umask is the umask inside the container. + Umask string `json:"Umask,omitempty"` } // InspectRestartPolicy holds information about the container's restart policy. |