[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Get Max uidNumber ...

On Fri, 26 Oct 2001, Ignacio Coupeau wrote:

> "C.Lee Taylor" wrote:
> > 
> > Greetings ...
> > 
> >         I search the archives and found that there was a few ideas how to do
> > this, so I thought that I would though out my idea and see you guys bash
> > it ... no pun intended ... I know this would be slow if one was tring to
> > bring in more than a few users, but then I use it just to add a few
> > users at a time ... I also believe this would not be a good idea to have
> > more than one user adding in users, because the uidNumber could go up
> > while we import the next user.
> > 
> I added an maxAccount objectClass wit "MUST uidNumber..." and update it
> by one...
> but test before call to the ldap_add if the uid was "stolen" by other
> concurrent process... if the uid is in use perform a new maxAccount read
> cycle...

We have a more than one server that is responsible for creating users in
LDAP.  We wrote a daemon that is responsible for dishing out the next
available uidNumber and managing the current set of uidNumberss.  Instead
of trying to determine the uidNumber through LDAP, we consult the daemon.  
The daemon uses a dbm to keep track of the uidNumbers in use.  The daemon
will also notify us if there is a uidNumber conflict.

- Christoph