diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-04-19 13:17:25 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-04-22 15:32:36 +0200 |
commit | 24f00e4695003c923915b7721dd4e96b844539ee (patch) | |
tree | e5d87277b39be2fb7c22d8122802b89335b7febb /pkg/rootless | |
parent | 21c77846e4b441d1da4a27a416c2f4dcd8e68cff (diff) | |
download | podman-24f00e4695003c923915b7721dd4e96b844539ee.tar.gz podman-24f00e4695003c923915b7721dd4e96b844539ee.tar.bz2 podman-24f00e4695003c923915b7721dd4e96b844539ee.zip |
rootless: if root is not sub?id raise a debug message
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/rootless')
-rw-r--r-- | pkg/rootless/rootless_linux.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index dda230dbc..83d4d7281 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -180,8 +180,11 @@ func GetConfiguredMappings() ([]idtools.IDMap, []idtools.IDMap, error) { } mappings, err := idtools.NewIDMappings(username, username) if err != nil { - logrus.Errorf( - "cannot find UID/GID for user %s: %v - check rootless mode in man pages.", username, err) + logLevel := logrus.ErrorLevel + if os.Geteuid() == 0 && GetRootlessUID() == 0 { + logLevel = logrus.DebugLevel + } + logrus.StandardLogger().Logf(logLevel, "cannot find UID/GID for user %s: %v - check rootless mode in man pages.", username, err) } else { uids = mappings.UIDs() gids = mappings.GIDs() |