Rauno Tuul wrote:
> Hi,
>
> In smbldap-useradd.pl is a pice of code, which find the first unused uid
> starting from $UID_START (for example 1000).
>
> if (!defined($userUidNumber)) {
> # find first unused uid starting from $UID_START
> while (defined(getpwuid($UID_START))) {
> $UID_START++;
> }
>
> I've over 500 UID's in use (maximum UID is 1547).
> It works well, until you delete an user. After deleting an user, there
comes
> a random uid available between 1000 and 1547. When useradd script is called
> again, it assign the same UID to new user/machine and files that belonged
to
> the old user, belong now to the new user. It has happened, that a machine
> account has a profile in windows server.
>
> Is there a way to modify smbldap-useradd.pl, that it would find keep in
> mind, which UID is the greatest and just do uid++? Or find the greatest UID
> and do ++.
>
> Anyone has a good idea, how to fix this?
The idea would be to add support to smbldap-tools for an uidpool in the
directory.
One more LDAP search to find the next uidNumber, but many many less than
doing incremental searches to find the hole to fill, and moreover it
solves your problem.
uidPool is somewhat described here :
http://www.openldap.org/lists/openldap-software/200402/msg00272.html
It is also, as said in the mail, described in Gerald's book. Gerald may
provide more details, or you may buy the book and patch smbldap-tools.
Regards,
J?r?me
--
J?r?me Fenal - Consultant Unix/SAN/Logiciel Libre
Groupe Expert & Managed Services - LogicaCMG France
http://www.logicacmg.com/fr/ - <mailto:jerome.fenal AT logicacmg.com>