[Samba] smbldap-tools: only incremental UID's?

Rauno Tuul rauno.tuul at haigekassa.ee
Tue Feb 17 07:43:31 GMT 2004


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?

rgds,

 Rauno Tuul


More information about the samba mailing list