testutil/daemon: shorten XDG_RUNTIME_DIR
XDG_RUNTIME_DIR will contain sockets so its path mustn't be too long. Prior to this commit, it was set to very long path like `/go/src/github.com/docker/docker/bundles/test-integration/TestDiskUsage/de4fb36576d7d/xdgrun` Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
af4f6c124d
commit
ae9fbcb82c
1 changed files with 3 additions and 1 deletions
|
@ -174,7 +174,9 @@ func NewDaemon(workingDir string, ops ...Option) (*Daemon, error) {
|
|||
if err := os.Chown(d.execRoot, uid, gid); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
d.rootlessXDGRuntimeDir = filepath.Join(d.Folder, "xdgrun")
|
||||
// $XDG_RUNTIME_DIR mustn't be too long, as ${XDG_RUNTIME_DIR/dockerd-rootless
|
||||
// contains Unix sockets
|
||||
d.rootlessXDGRuntimeDir = filepath.Join(os.TempDir(), "xdgrun-"+id)
|
||||
if err := os.MkdirAll(d.rootlessXDGRuntimeDir, 0o700); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue