]> git.ipfire.org Git - thirdparty/shadow.git/commit
useradd: fix subuid allocation
authorSerge Hallyn <serge@hallyn.com>
Fri, 17 Jul 2026 16:03:45 +0000 (11:03 -0500)
committerSerge Hallyn <serge@hallyn.com>
Fri, 17 Jul 2026 17:14:47 +0000 (12:14 -0500)
commit764e56e9ec293b8ab884999c85916d5279a1975a
tree5a0d1178e507d8edd0fe2395e68258dcf1d9195e
parent091c7399008f4e2a5d5c4c452978691329cea95e
useradd: fix subuid allocation

closes #1683

The decision on whether to allocate a subuid is dependent
on user_id != 0, but user_id is not filled in until after
the call to this.  I spent a few minutes trying to track
down where this ordering changed, and haven't found it yet.
We can add a fixes tag if we track it down.

Move the decision on whether to calculate it to after we
calculate user_id.  Then, because that decision is used to
decide whether to open the subuid_db, and pull the subuid
db opening out of open_files and run it later.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
src/useradd.c