If no group is specified, use the user's primary group

This commit is contained in:
Justin Maggard
2017-10-06 16:05:01 -07:00
parent 7a27ce3077
commit ad5d6413a7
2 changed files with 6 additions and 2 deletions

View File

@ -734,6 +734,8 @@ init(int argc, char **argv)
DPRINTF(E_FATAL, L_GENERAL, "Bad user '%s'.\n",
ary_options[i].value);
uid = entry->pw_uid;
if (!gid)
gid = entry->pw_gid;
}
break;
case FORCE_SORT_CRITERIA:
@ -873,6 +875,8 @@ init(int argc, char **argv)
if (!entry)
DPRINTF(E_FATAL, L_GENERAL, "Bad user '%s'.\n", argv[i]);
uid = entry->pw_uid;
if (!gid)
gid = entry->pw_gid;
}
}
else