shadow-utils/shadow-4.6-useradd-check-if-subid-range-exists.patch
Iker Pedrosa 1c073900c8 - Update patch to close label to reset libselinux state
- useradd: check if subid range exists for user
- find_new_[gu]id: Skip over IDs that are reserved for legacy reasons

Resolves: #1984740
Resolves: #2012929
Resolves: #1994269

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-05-17 11:58:06 +02:00

21 lines
896 B
Diff

diff -up shadow-4.6/src/useradd.c.useradd-check-if-subid-range-exists shadow-4.6/src/useradd.c
--- shadow-4.6/src/useradd.c.useradd-check-if-subid-range-exists 2023-05-17 10:39:41.457826153 +0200
+++ shadow-4.6/src/useradd.c 2023-05-17 10:41:30.937036772 +0200
@@ -2019,14 +2019,14 @@ static void usr_update (void)
fail_exit (E_PW_UPDATE);
}
#ifdef ENABLE_SUBIDS
- if (is_sub_uid &&
+ if (is_sub_uid && !local_sub_uid_assigned(user_name) &&
(sub_uid_add(user_name, sub_uid_start, sub_uid_count) == 0)) {
fprintf (stderr,
_("%s: failed to prepare the new %s entry\n"),
Prog, sub_uid_dbname ());
fail_exit (E_SUB_UID_UPDATE);
}
- if (is_sub_gid &&
+ if (is_sub_gid && !local_sub_gid_assigned(user_name) &&
(sub_gid_add(user_name, sub_gid_start, sub_gid_count) == 0)) {
fprintf (stderr,
_("%s: failed to prepare the new %s entry\n"),