mirror of
https://github.com/containers/podman.git
synced 2025-09-28 17:25:31 +08:00
utils: avoid too long tmp directory
or we will easily pass the 108 chars limits for unix paths. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -195,7 +195,7 @@ func GetRootlessRuntimeDir() (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if runtimeDir == "" {
|
if runtimeDir == "" {
|
||||||
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("libpod-rundir-%s", uid))
|
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("run-%s", uid))
|
||||||
os.MkdirAll(tmpDir, 0700)
|
os.MkdirAll(tmpDir, 0700)
|
||||||
st, err := os.Stat(tmpDir)
|
st, err := os.Stat(tmpDir)
|
||||||
if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && st.Mode().Perm() == 0700 {
|
if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && st.Mode().Perm() == 0700 {
|
||||||
|
Reference in New Issue
Block a user