[Fedora-directory-users] ObjectClass PosixGroup + UID/GID auto-generation
Michael Ströder
michael at stroeder.com
Wed Aug 13 08:33:10 UTC 2008
Kashif Ali wrote:
> how would you search for the next value? I.e search all UID/GID and show
> you the results, I could then sort them and work out which number should
> be next?
The idea with using a pool was to increment the ID as pointed out in the
example code posted by Ryan.
Additionally you should have a unique constraint configured for these
attributes.
Ciao, Michael.
>
> 2008/8/12 Michael Ströder <michael at stroeder.com
> <mailto:michael at stroeder.com>>
>
> Ryan Braun [ADS] wrote:
>
> On Monday 11 August 2008 11:35, Kashif Ali wrote:
>
> But basically, you just create an object that holds 2 values.
> The current available UID and GID. Then your perl script
> queries ldap for that object, uses the available UID, then
> increments it and writes it back to ldap.
>
> > [..]
>
> $mesg = $ldap->modify("cn=idPool,ou=Special
> Users,$config{BASE_DN}", replace => { "uidNumber" =>
> $config{NextID}+1 } );
>
>
> FWIW the original idea was different: For this to work reliably with
> multiple instances generating IDs from the same ID pool entry you
> have to explicitly delete the old value and add the new one. If the
> ID was already incremented by another process the old value was
> already replaced and the modify request fails.
>
> Ciao, Michael.
More information about the 389-users
mailing list