7

I have one attribute (groupIDNumber), I want to make it work as auto-increment number?

How can we define that attr?

Thank for your help,

-nm

nm.
  • 71
  • 1
  • 2

2 Answers2

4

This blog suggests that you can achieve the equivalent by creating a new object that is sort of a sequence. A working implementation in OpenLDAP is reported here. The object is defined as follows (note: not my code, just reproducing what was reported):

----------------------------------------------
objectClass ( 1.3.6.1.4.1.4203.666.599
    NAME 'uidNext'
    SUP top STRUCTURAL
    MUST ( cn $ uidNumber ) )
----------------------------------------------

LDIF entiries are then written as:

--- increment.ldif ------------------------------- 
dn: cn=uidNext,dc=example,dc=com
changetype: modify
increment:uidNumber
uidNumber: 1
-
---- EOF ------------------------------------------

And called with:

$ ldapadd -x -D "cn=Admin,dc=example,dc=com" -wsecret -f ./autoinc.ldif
beldaz
  • 4,299
  • 3
  • 43
  • 63
2

This is not part of the LDAP protocol, nor is it a standard thing to do. It is something you would normally do in your client-side logic. However, depending on which LDAP server you are using, it may be possible to achieve using a plugin or extension.

Andrew Strong
  • 4,303
  • 2
  • 24
  • 26