[Adduser-devel] Bug#119597: Re: adduser: do not call getpwent in a loop if possible

Marc Haber mh+debian-packages at zugschlus.de
Wed Nov 2 21:01:58 UTC 2005

On Tue, Oct 25, 2005 at 10:18:32PM +0200, Joerg Hoh wrote:
> Exchanging the
> setgrent;
> push @gids, $gid while defined($gid = (getgrent)[2]);
> endgrent;
> loop with something similar to this
> my $id = $min;
> while (defined(getpwuid($id))) $id++;
> return $id;
> has probably the already mentioned effect of slowing down when using
> "files" NSS. But if the case is "slow vs fails because the LDAP server
> doesn't even return all wanted values" slow code is acceptable.

Maybe we could have a configuration option for that, defaulting to the
version that is better for "files" NSS.

> But we still need to consider that adduser isn't the right tool if you
> use LDAP (see #294579).

Even on an LDAP-based system, new packages being installed will use
adduser to create their package/daemon accounts. I think that this is
the normal case where adduser will be used on an LDAP-based system.


Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835

More information about the Adduser-devel mailing list