summaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorChristian Felder <c.felder@fz-juelich.de>2019-09-09 14:57:05 +0200
committerChristian Felder <c.felder@fz-juelich.de>2019-09-09 15:17:42 +0200
commitf44b05f6fda6ec91bc21088321da739ce26cfe2d (patch)
tree6ce868c726a6c6eda915d3f4765be3933e3f55da /pkg/util
parentd78521de11c524d7b8ceee02b726f66da6d3301c (diff)
downloadpodman-f44b05f6fda6ec91bc21088321da739ce26cfe2d.tar.gz
podman-f44b05f6fda6ec91bc21088321da739ce26cfe2d.tar.bz2
podman-f44b05f6fda6ec91bc21088321da739ce26cfe2d.zip
Fixup `util.GetRootlessConfigHomeDir` permission requirements
Do not require 0755 permissons for the ~/.config directory but require at least 0700 which should be sufficient. The current implementation internally creates this directory with 0755 if it does not exist, but if the directory already exists with different perissions the current code returns an empty string. Signed-off-by: Christian Felder <c.felder@fz-juelich.de>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/utils_supported.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/util/utils_supported.go b/pkg/util/utils_supported.go
index 707e193e9..253460686 100644
--- a/pkg/util/utils_supported.go
+++ b/pkg/util/utils_supported.go
@@ -83,7 +83,7 @@ func GetRootlessConfigHomeDir() (string, error) {
logrus.Errorf("unable to make temp dir %s", tmpDir)
}
st, err := os.Stat(tmpDir)
- if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && st.Mode().Perm() == 0755 {
+ if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && st.Mode().Perm() >= 0700 {
cfgHomeDir = tmpDir
}
}