Blame SOURCES/shadow-4.6-useradd_dont_try_to_create_0_subuids.patch

9ed61c
diff -up shadow-4.6/src/useradd.c.useradd_dont_try_to_create_0_subuids shadow-4.6/src/useradd.c
9ed61c
--- shadow-4.6/src/useradd.c.useradd_dont_try_to_create_0_subuids	2021-11-03 11:55:00.189562187 +0100
9ed61c
+++ shadow-4.6/src/useradd.c	2021-11-03 11:57:34.128658978 +0100
9ed61c
@@ -2350,7 +2350,7 @@ int main (int argc, char **argv)
9ed61c
 	}
9ed61c
 
9ed61c
 #ifdef ENABLE_SUBIDS
9ed61c
-	if (is_sub_uid) {
9ed61c
+	if (is_sub_uid && subuid_count != 0) {
9ed61c
 		if (find_new_sub_uids(user_name, &sub_uid_start, &sub_uid_count) < 0) {
9ed61c
 			fprintf (stderr,
9ed61c
 			         _("%s: can't create subordinate user IDs\n"),
9ed61c
@@ -2358,7 +2358,7 @@ int main (int argc, char **argv)
9ed61c
 			fail_exit(E_SUB_UID_UPDATE);
9ed61c
 		}
9ed61c
 	}
9ed61c
-	if (is_sub_gid) {
9ed61c
+	if (is_sub_gid && subgid_count != 0) {
9ed61c
 		if (find_new_sub_gids(user_name, &sub_gid_start, &sub_gid_count) < 0) {
9ed61c
 			fprintf (stderr,
9ed61c
 			         _("%s: can't create subordinate group IDs\n"),