mirror of
https://github.com/containers/podman.git
synced 2025-09-27 00:34:32 +08:00
Bump github.com/containers/storage from 1.21.1 to 1.21.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.21.1 to 1.21.2. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.21.1...v1.21.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
![27856297+dependabot-preview[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
Daniel J Walsh

parent
344a791ac2
commit
4c7fc773f6
27
vendor/github.com/containers/storage/pkg/unshare/unshare.go
generated
vendored
27
vendor/github.com/containers/storage/pkg/unshare/unshare.go
generated
vendored
@ -4,19 +4,30 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/user"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
homeDirOnce sync.Once
|
||||
homeDirErr error
|
||||
homeDir string
|
||||
)
|
||||
|
||||
// HomeDir returns the home directory for the current user.
|
||||
func HomeDir() (string, error) {
|
||||
home := os.Getenv("HOME")
|
||||
if home == "" {
|
||||
usr, err := user.LookupId(fmt.Sprintf("%d", GetRootlessUID()))
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "unable to resolve HOME directory")
|
||||
homeDirOnce.Do(func() {
|
||||
home := os.Getenv("HOME")
|
||||
if home == "" {
|
||||
usr, err := user.LookupId(fmt.Sprintf("%d", GetRootlessUID()))
|
||||
if err != nil {
|
||||
homeDir, homeDirErr = "", errors.Wrapf(err, "unable to resolve HOME directory")
|
||||
return
|
||||
}
|
||||
homeDir, homeDirErr = usr.HomeDir, nil
|
||||
}
|
||||
home = usr.HomeDir
|
||||
}
|
||||
return home, nil
|
||||
homeDir, homeDirErr = home, nil
|
||||
})
|
||||
return homeDir, homeDirErr
|
||||
}
|
||||
|
Reference in New Issue
Block a user