Skip to content

Commit

Permalink
use default user group when -u <user> is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
ndilieto committed Jun 3, 2021
1 parent 76b147c commit b2cf904
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ualpn.c
Expand Up @@ -4266,6 +4266,15 @@ int main(int argc, char **argv)
cleanup_and_exit(0, EXIT_FAILURE);
}
g.uid = pwd->pw_uid;
if (g.group == NULL) {
g.gid = pwd->pw_gid;
grp = getgrgid(g.gid);
if (!grp) {
errx("getgrgid(%d) failed", g.gid);
cleanup_and_exit(0, EXIT_FAILURE);
}
g.group = grp->gr_name;
}
server_mode = true;
}
break;
Expand Down

0 comments on commit b2cf904

Please sign in to comment.