Fix malformed patch.

This commit is contained in:
Tomas Mraz 2018-11-06 10:53:00 +01:00
parent f38d60a562
commit 1a1e7474b6
1 changed files with 10 additions and 8 deletions

View File

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