summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpod/container_internal.go2
-rw-r--r--pkg/rootless/rootless_linux.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 3d94fa871..9d5335780 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1286,7 +1286,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
}
// Look up and add groups the user belongs to, if a group wasn't directly specified
- if !strings.Contains(c.config.User, ":") {
+ if !rootless.IsRootless() && !strings.Contains(c.config.User, ":") {
groups, err := chrootuser.GetAdditionalGroupsForUser(c.state.Mountpoint, uint64(g.Spec().Process.User.UID))
if err != nil && errors.Cause(err) != chrootuser.ErrNoSuchUser {
return nil, err
diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c
index f107af7c7..163f46052 100644
--- a/pkg/rootless/rootless_linux.c
+++ b/pkg/rootless/rootless_linux.c
@@ -66,6 +66,8 @@ get_cmd_line_args (pid_t pid)
argc++;
argv = malloc (sizeof (char *) * (argc + 1));
+ if (argv == NULL)
+ return NULL;
argc = 0;
argv[argc++] = buffer;