diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-07 11:24:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-07 11:24:57 -0800 |
commit | e9f8aed407f3e05f47e3eb40b23aa7c2f57e0a60 (patch) | |
tree | a59158e189a28ca06bb263f200ac71d9d4cb1e67 /pkg/lookup/lookup.go | |
parent | 1370c311f57673d6e3bfc529bc9819d472cfcecb (diff) | |
parent | ae68bec75cf59e8a530dbc55f320f7bb0be9a62b (diff) | |
download | podman-e9f8aed407f3e05f47e3eb40b23aa7c2f57e0a60.tar.gz podman-e9f8aed407f3e05f47e3eb40b23aa7c2f57e0a60.tar.bz2 podman-e9f8aed407f3e05f47e3eb40b23aa7c2f57e0a60.zip |
Merge pull request #1764 from rhatdan/nopasswd
Don't fail if /etc/passwd or /etc/group does not exists
Diffstat (limited to 'pkg/lookup/lookup.go')
-rw-r--r-- | pkg/lookup/lookup.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/lookup/lookup.go b/pkg/lookup/lookup.go index b27e2a724..a9d975b4b 100644 --- a/pkg/lookup/lookup.go +++ b/pkg/lookup/lookup.go @@ -1,10 +1,12 @@ package lookup import ( + "os" + "strconv" + "github.com/cyphar/filepath-securejoin" "github.com/opencontainers/runc/libcontainer/user" "github.com/sirupsen/logrus" - "strconv" ) const ( @@ -116,7 +118,7 @@ func GetUser(containerMount, userIDorName string) (*user.User, error) { } return u.Uid == uid }) - if err != nil { + if err != nil && !os.IsNotExist(err) { return nil, err } if len(users) > 0 { @@ -146,7 +148,7 @@ func GetGroup(containerMount, groupIDorName string) (*user.Group, error) { } return g.Gid == gid }) - if err != nil { + if err != nil && !os.IsNotExist(err) { return nil, err } if len(groups) > 0 { |