[Adduser-devel] Bug#482069: adduser: If uid 999 exists, next system uid will be between 0-99

Joerg Hoh joerg at joerghoh.de
Tue May 20 18:39:19 UTC 2008


On Tue, May 20, 2008 at 05:57:50PM +0200, Durk Strooisma wrote:

> 
> If, for whatever reason, there's a system user having uid 999, adduser
> will look for a uid starting from 0 when a new system user is created.

I guess the relevant part starts at line 387 off adduser

   elsif (!defined($new_uid) && !$make_group_also) {
        $new_uid = &first_avail_uid($config{"first_system_uid"},
                                   $config{"last_system_uid"});
        if ($new_uid == -1) {
            print STDERR "$0: ";
            printf STDERR gtx("No UID is available in the range %d-%d (FIRST_SYS_UID - LAST_SYS_UID).\n"),$config{"first_system_uid"},$config{"last_system_uid"};
            dief (gtx("The user `%s' was not created.\n"),$new_name);
        }

if first_avail_uid returns -1 (which is indicating that in the range
FIRST_SYS_UID and LAST_SYS_UID there was no free uid), adduser will stop.
I don't see any overflow which causes adduser to start at uid 0 again.

Please correct me if I'm wrong, but I don't get the problem.


Jörg
-- 
What did you do to the cat? It looks half-dead. -Schroedinger's wife
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/adduser-devel/attachments/20080520/7bc5d190/attachment.pgp 


More information about the Adduser-devel mailing list