On 2025-03-03 23:18:35 +0100, Michael Musenbrock wrote:
> This maybe looks more like an issue in adduser?
Yes, I've just reassigned the bug to adduser.
> So changing the shadow password field from '*' (no pwd) to '!'
> (locked) allows adduser to pass.
Because
use constant {
EXISTING_NOT_FOUND => 0,
EXISTING_FOUND => 1,
EXISTING_SYSTEM => 2,
EXISTING_ID_MISMATCH => 4,
EXISTING_LOCKED => 8,
};
and the test is
if ($ret == (EXISTING_FOUND|EXISTING_SYSTEM)) {
# a user with this name already exists; it's a problem when it's not a
system user
log_fatal( mtx("The user `%s' already exists, but is not a system user.
Exiting."), $new_name );
exit( RET_WRONG_OBJECT_PROPERTIES );
}
So, if EXISTING_LOCKED is set, then the test will be false
and will not trigger the error.
BTW, I don't understand why the test is written to depend
on the lock status.
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)