summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-06-27 13:52:29 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-06-27 13:52:36 +0200
commitbfcf0292de21bb75ec0b68a6af1879b29458bad2 (patch)
tree68c07a7d0a565aafe4e4c0330b766e3884a1afbc /libpod
parentfccf4ad50327d6b74b3d3fa54bce449ea93a85cf (diff)
downloadpodman-bfcf0292de21bb75ec0b68a6af1879b29458bad2.tar.gz
podman-bfcf0292de21bb75ec0b68a6af1879b29458bad2.tar.bz2
podman-bfcf0292de21bb75ec0b68a6af1879b29458bad2.zip
runtime: use GetRootlessUID() to get rootless uid
otherwise it won't work in a user namespace. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 97eb565cc..884bb6213 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -373,7 +373,7 @@ func NewRuntimeFromConfig(ctx context.Context, userConfigPath string, options ..
func homeDir() (string, error) {
home := os.Getenv("HOME")
if home == "" {
- usr, err := user.Current()
+ usr, err := user.LookupId(fmt.Sprintf("%d", rootless.GetRootlessUID()))
if err != nil {
return "", errors.Wrapf(err, "unable to resolve HOME directory")
}