summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-07-11 08:56:59 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2018-07-11 09:23:00 +0200
commit7e3c0d493e1afbae284071643d1a46c571776a04 (patch)
tree24ed5a2d5f5e0fbd863eb0ce11abefc50c54df4e /cmd/podman
parent84cfdb20617ac7a5a1138375599e28cdad26b824 (diff)
downloadpodman-7e3c0d493e1afbae284071643d1a46c571776a04.tar.gz
podman-7e3c0d493e1afbae284071643d1a46c571776a04.tar.bz2
podman-7e3c0d493e1afbae284071643d1a46c571776a04.zip
rootless: resolve the user home directory
Closes: https://github.com/projectatomic/libpod/issues/1073 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/libpodruntime/runtime.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index b48667653..e8177d5ee 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -6,6 +6,7 @@ import (
"path/filepath"
"github.com/containers/storage"
+ "github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod"
"github.com/projectatomic/libpod/pkg/rootless"
"github.com/urfave/cli"
@@ -31,7 +32,13 @@ func GetRootlessStorageOpts() (storage.StoreOptions, error) {
if home == "" {
return opts, fmt.Errorf("neither XDG_DATA_HOME nor HOME was set non-empty")
}
- dataDir = filepath.Join(home, ".local", "share")
+ // runc doesn't like symlinks in the rootfs path, and at least
+ // on CoreOS /home is a symlink to /var/home, so resolve any symlink.
+ resolvedHome, err := filepath.EvalSymlinks(home)
+ if err != nil {
+ return opts, errors.Wrapf(err, "cannot resolve %s", home)
+ }
+ dataDir = filepath.Join(resolvedHome, ".local", "share")
}
opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
opts.GraphDriverName = "vfs"