Use user-specific temp directory if set

This allows non-privileged users to use containerd. This is part of a
larger track of work integrating containerd into Cloudfoundry's garden
with support for rootless.

[#156343575]

Signed-off-by: Claudia Beresford <cberesford@pivotal.io>
This commit is contained in:
Tom Godkin
2018-05-04 10:27:58 +01:00
committed by Claudia Beresford
parent 40c3acd36c
commit fc8bce59b9
6 changed files with 14 additions and 7 deletions

View File

@@ -53,7 +53,7 @@ func WithDefaultProfile(name string) oci.SpecOpts {
if err != nil {
return err
}
f, err := ioutil.TempFile("", p.Name)
f, err := ioutil.TempFile(os.Getenv("XDG_RUNTIME_DIR"), p.Name)
if err != nil {
return err
}