summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-07 11:24:57 -0800
committerGitHub <noreply@github.com>2018-11-07 11:24:57 -0800
commite9f8aed407f3e05f47e3eb40b23aa7c2f57e0a60 (patch)
treea59158e189a28ca06bb263f200ac71d9d4cb1e67 /libpod/container_internal.go
parent1370c311f57673d6e3bfc529bc9819d472cfcecb (diff)
parentae68bec75cf59e8a530dbc55f320f7bb0be9a62b (diff)
downloadpodman-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 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 6843759a6..d2f48d661 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
- "github.com/opencontainers/runc/libcontainer/user"
"io"
"io/ioutil"
"os"
@@ -27,6 +26,7 @@ import (
"github.com/containers/storage/pkg/archive"
"github.com/containers/storage/pkg/chrootarchive"
"github.com/containers/storage/pkg/mount"
+ "github.com/opencontainers/runc/libcontainer/user"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/selinux/go-selinux/label"
@@ -1139,7 +1139,7 @@ func (c *Container) generatePasswd() (string, error) {
}
originPasswdFile := filepath.Join(c.state.Mountpoint, "/etc/passwd")
orig, err := ioutil.ReadFile(originPasswdFile)
- if err != nil {
+ if err != nil && !os.IsNotExist(err) {
return "", errors.Wrapf(err, "unable to read passwd file %s", originPasswdFile)
}