Skip to content

Commit f44b05f

Browse files
committed
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 <[email protected]>
1 parent d78521d commit f44b05f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/util/utils_supported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func GetRootlessConfigHomeDir() (string, error) {
8383
logrus.Errorf("unable to make temp dir %s", tmpDir)
8484
}
8585
st, err := os.Stat(tmpDir)
86-
if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && st.Mode().Perm() == 0755 {
86+
if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && st.Mode().Perm() >= 0700 {
8787
cfgHomeDir = tmpDir
8888
}
8989
}

0 commit comments

Comments
 (0)