Blame SOURCES/shadow-4.6-sysugid-min-limit.patch

2de3ab
diff -up shadow-4.6/libmisc/find_new_gid.c.min-limit shadow-4.6/libmisc/find_new_gid.c
2de3ab
--- shadow-4.6/libmisc/find_new_gid.c.min-limit	2018-04-29 18:42:37.000000001 +0200
2de3ab
+++ shadow-4.6/libmisc/find_new_gid.c	2018-11-06 10:51:20.554963292 +0100
2de3ab
@@ -82,6 +82,13 @@ static int get_ranges (bool sys_group, g
2de3ab
                             (unsigned long) *max_id);
2de3ab
 			return EINVAL;
2de3ab
 		}
2de3ab
+		/*
2de3ab
+		 * Zero is reserved for root and the allocation algorithm does not
2de3ab
+		 * work right with it.
2de3ab
+		 */
2de3ab
+		if (*min_id == 0) {
2de3ab
+			*min_id = (gid_t) 1;
2de3ab
+		}
2de3ab
 	} else {
2de3ab
 		/* Non-system groups */
2de3ab
 
2de3ab
diff -up shadow-4.6/libmisc/find_new_uid.c.min-limit shadow-4.6/libmisc/find_new_uid.c
2de3ab
--- shadow-4.6/libmisc/find_new_uid.c.min-limit	2018-04-29 18:42:37.000000001 +0200
2de3ab
+++ shadow-4.6/libmisc/find_new_uid.c	2018-11-06 10:51:39.341399569 +0100
2de3ab
@@ -82,6 +82,13 @@ static int get_ranges (bool sys_user, ui
2de3ab
                             (unsigned long) *max_id);
2de3ab
 			return EINVAL;
2de3ab
 		}
2de3ab
+		/*
2de3ab
+		 * Zero is reserved for root and the allocation algorithm does not
2de3ab
+		 * work right with it.
2de3ab
+		 */
2de3ab
+		if (*min_id == 0) {
2de3ab
+			*min_id = (uid_t) 1;
2de3ab
+		}
2de3ab
 	} else {
2de3ab
 		/* Non-system users */
2de3ab