summaryrefslogtreecommitdiff
path: root/pkg/rootless
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-11-09 11:22:44 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2018-11-10 04:46:06 -0500
commit542d8fe95f66c0a3aabb9d964c260a0b3b9aaae8 (patch)
treefda08bb58dadba3915e3c92d47419e9daa29358c /pkg/rootless
parent78e6d8e7d70d431ccf096dee0f8eadb1c9b2967b (diff)
downloadpodman-542d8fe95f66c0a3aabb9d964c260a0b3b9aaae8.tar.gz
podman-542d8fe95f66c0a3aabb9d964c260a0b3b9aaae8.tar.bz2
podman-542d8fe95f66c0a3aabb9d964c260a0b3b9aaae8.zip
Better document rootless containers
Need to return an error pointing user in right direction if rootless podman fails, because of no /etc/subuid or /etc/subgid files. Also fix up man pages to better describe rootless podman. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/rootless')
-rw-r--r--pkg/rootless/rootless_linux.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index 5c45f2694..ff8c8fe34 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -187,6 +187,9 @@ func BecomeRootInUserNS() (bool, int, error) {
if username == "" {
user, err := user.LookupId(fmt.Sprintf("%d", os.Getuid()))
if err != nil && os.Getenv("PODMAN_ALLOW_SINGLE_ID_MAPPING_IN_USERNS") == "" {
+ if os.IsNotExist(err) {
+ return false, 0, errors.Wrapf(err, "/etc/subuid or /etc/subgid does not exist, see subuid/subgid man pages for information on these files")
+ }
return false, 0, errors.Wrapf(err, "could not find user by UID nor USER env was set")
}
if err == nil {