]> git.ipfire.org Git - thirdparty/shadow.git/commit
useradd: avoid generating an empty subid range 399/head
authorIker Pedrosa <ipedrosa@redhat.com>
Tue, 10 Aug 2021 07:07:03 +0000 (09:07 +0200)
committerIker Pedrosa <ipedrosa@redhat.com>
Tue, 10 Aug 2021 08:04:39 +0000 (10:04 +0200)
commit9dd720a28578eef5be8171697aae0906e4c53249
tree5ec98121d5b343280576b02888b8d22c1b422f97
parent1c1e0b0c688f6dc4ba99787e42f6ecbee536c01d
useradd: avoid generating an empty subid range

useradd generates an empty subid range when adding a new user. This is
caused because there are two variables, one local and the other one
global, that have a very similar name and they are used indistinctly in
the code. The local variable loads the SUB_*ID_COUNT configuration from
the login.defs file, while the global variable, which holds a value of
0, is used to generate the subid range. Causing the empty subid range
problem.

I've merged the two variables in the local one and removed the global
variable. I prefer to do it this way to reduce the scope of it but I'm
open to doing it the other way round.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1990653

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
src/useradd.c