shadow-utils/shadow-4.9-useradd-modify-check-ID-range-for-system-users.patch
Iker Pedrosa 1fa6b1e5d5 - useradd: modify check ID range for system users
- Fix release sources
- Add subid requirement for subid-devel

Resolves: #2004911

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2022-04-22 15:13:49 +02:00

20 lines
991 B
Diff

diff -up shadow-4.9/src/useradd.c.useradd-modify-check-ID-range-for-system-users shadow-4.9/src/useradd.c
--- shadow-4.9/src/useradd.c.useradd-modify-check-ID-range-for-system-users 2022-04-22 14:50:10.658371270 +0200
+++ shadow-4.9/src/useradd.c 2022-04-22 14:54:34.810100549 +0200
@@ -2319,12 +2319,10 @@ static void check_uid_range(int rflg, ui
{
uid_t uid_min ;
uid_t uid_max ;
- if(rflg){
- uid_min = (uid_t)getdef_ulong("SYS_UID_MIN",101UL);
+ if (rflg) {
uid_max = (uid_t)getdef_ulong("SYS_UID_MAX",getdef_ulong("UID_MIN",1000UL)-1);
- if(uid_min <= uid_max){
- if(user_id < uid_min || user_id >uid_max)
- fprintf(stderr, _("%s warning: %s's uid %d outside of the SYS_UID_MIN %d and SYS_UID_MAX %d range.\n"), Prog, user_name, user_id, uid_min, uid_max);
+ if (user_id > uid_max) {
+ fprintf(stderr, _("%s warning: %s's uid %d is greater than SYS_UID_MAX %d\n"), Prog, user_name, user_id, uid_max);
}
}else{
uid_min = (uid_t)getdef_ulong("UID_MIN", 1000UL);