diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-17 16:12:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-17 16:12:47 -0400 |
commit | 10c5f241231a55a90a37b9f578c84a6bb23ae33e (patch) | |
tree | c4cd71f522523cb9f5be4ebcb4b53ead7be74575 /pkg/spec/spec.go | |
parent | dfca83d37cefdde966c8b770058a9b9fd5f8ed20 (diff) | |
parent | 65d382dc689805750c71756d9e43d04007ad4fd5 (diff) | |
download | podman-10c5f241231a55a90a37b9f578c84a6bb23ae33e.tar.gz podman-10c5f241231a55a90a37b9f578c84a6bb23ae33e.tar.bz2 podman-10c5f241231a55a90a37b9f578c84a6bb23ae33e.zip |
Merge pull request #7005 from giuseppe/set-umask-rlimits
abi: set default umask and rlimits
Diffstat (limited to 'pkg/spec/spec.go')
-rw-r--r-- | pkg/spec/spec.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go index 6f52b88b1..b974772d5 100644 --- a/pkg/spec/spec.go +++ b/pkg/spec/spec.go @@ -505,10 +505,9 @@ func BlockAccessToKernelFilesystems(privileged, pidModeIsHost bool, g *generate. func addRlimits(config *CreateConfig, g *generate.Generator) error { var ( - kernelMax uint64 = 1048576 - isRootless = rootless.IsRootless() - nofileSet = false - nprocSet = false + isRootless = rootless.IsRootless() + nofileSet = false + nprocSet = false ) for _, u := range config.Resources.Ulimit { @@ -538,8 +537,8 @@ func addRlimits(config *CreateConfig, g *generate.Generator) error { // files and number of processes to the maximum they can be set to // (without overriding a sysctl) if !nofileSet { - max := kernelMax - current := kernelMax + max := define.RLimitDefaultValue + current := define.RLimitDefaultValue if isRootless { var rlimit unix.Rlimit if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlimit); err != nil { @@ -555,8 +554,8 @@ func addRlimits(config *CreateConfig, g *generate.Generator) error { g.AddProcessRlimits("RLIMIT_NOFILE", max, current) } if !nprocSet { - max := kernelMax - current := kernelMax + max := define.RLimitDefaultValue + current := define.RLimitDefaultValue if isRootless { var rlimit unix.Rlimit if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlimit); err != nil { |