mirror of
https://github.com/containers/podman.git
synced 2025-05-28 21:46:51 +08:00
runtime: use GetRootlessUID() to get rootless uid
otherwise it won't work in a user namespace. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user