Merge pull request #306 from hallyn/2021-01-01/nosubids

useradd: don't try to create 0 subuids
This commit is contained in:
Serge Hallyn 2021-01-01 13:10:53 -06:00 committed by GitHub
commit ae169c4046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2581,7 +2581,7 @@ int main (int argc, char **argv)
} }
#ifdef ENABLE_SUBIDS #ifdef ENABLE_SUBIDS
if (is_sub_uid) { if (is_sub_uid && sub_uid_count != 0) {
if (find_new_sub_uids(&sub_uid_start, &sub_uid_count) < 0) { if (find_new_sub_uids(&sub_uid_start, &sub_uid_count) < 0) {
fprintf (stderr, fprintf (stderr,
_("%s: can't create subordinate user IDs\n"), _("%s: can't create subordinate user IDs\n"),
@ -2589,7 +2589,7 @@ int main (int argc, char **argv)
fail_exit(E_SUB_UID_UPDATE); fail_exit(E_SUB_UID_UPDATE);
} }
} }
if (is_sub_gid) { if (is_sub_gid && sub_gid_count != 0) {
if (find_new_sub_gids(&sub_gid_start, &sub_gid_count) < 0) { if (find_new_sub_gids(&sub_gid_start, &sub_gid_count) < 0) {
fprintf (stderr, fprintf (stderr,
_("%s: can't create subordinate group IDs\n"), _("%s: can't create subordinate group IDs\n"),