Skip to content

Commit

Permalink
Merge pull request containers#3717 from rhatdan/errors
Browse files Browse the repository at this point in the history
Don't log errors to the screen when XDG_RUNTIME_DIR is not set
  • Loading branch information
openshift-merge-robot authored Aug 4, 2019
2 parents 140e08e + 66485c8 commit d9ea4db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/utils_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func GetRootlessRuntimeDir() (string, error) {
if runtimeDir == "" {
tmpDir := filepath.Join("/run", "user", uid)
if err := os.MkdirAll(tmpDir, 0700); err != nil {
logrus.Errorf("unable to make temp dir %s", tmpDir)
logrus.Debugf("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() == 0700 {
Expand All @@ -36,7 +36,7 @@ func GetRootlessRuntimeDir() (string, error) {
if runtimeDir == "" {
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("run-%s", uid))
if err := os.MkdirAll(tmpDir, 0700); err != nil {
logrus.Errorf("unable to make temp dir %s", tmpDir)
logrus.Debugf("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() == 0700 {
Expand Down

0 comments on commit d9ea4db

Please sign in to comment.