Skip to content

Commit

Permalink
Fixup util.GetRootlessConfigHomeDir permission requirements
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cfelder committed Sep 9, 2019
1 parent d78521d commit f44b05f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/utils_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit f44b05f

Please sign in to comment.