Created
February 15, 2020 22:28
-
-
Save andrew-aladev/ff07c2ce331fba96918b0a8af62f6afd to your computer and use it in GitHub Desktop.
buildah temp user directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vendor/github.com/containers/storage/utils.go b/vendor/github.com/containers/storage/utils.go | |
index 28e0a8d..cc45d26 100644 | |
--- a/vendor/github.com/containers/storage/utils.go | |
+++ b/vendor/github.com/containers/storage/utils.go | |
@@ -87,12 +87,11 @@ func getRootlessRuntimeDir(rootlessUID int) (string, error) { | |
if runtimeDir != "" { | |
return runtimeDir, nil | |
} | |
- tmpDir := fmt.Sprintf("/run/user/%d", rootlessUID) | |
+ tmpDir := fmt.Sprintf("%s/buildah-user-%d", os.TempDir(), rootlessUID) | |
st, err := system.Stat(tmpDir) | |
if err == nil && int(st.UID()) == os.Getuid() && st.Mode()&0700 == 0700 && st.Mode()&0066 == 0000 { | |
return tmpDir, nil | |
} | |
- tmpDir = fmt.Sprintf("%s/%d", os.TempDir(), rootlessUID) | |
if err := os.MkdirAll(tmpDir, 0700); err != nil { | |
logrus.Errorf("failed to create %s: %v", tmpDir, err) | |
} else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment