samldb: Allow automatic generation of linkIDs and prevent duplicates
authorBob Campbell <bobcampbell@catalyst.net.nz>
Tue, 31 Jan 2017 22:54:40 +0000 (11:54 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Feb 2017 01:20:07 +0000 (02:20 +0100)
commit35be7ee8a49f000282859661fc6522c9d6c05020
tree185d19fc2057636214d2b986c9f41c0035e0e422
parent85d5b4339237a12d369c3522dbb44e98fd3a6c54
samldb: Allow automatic generation of linkIDs and prevent duplicates

As per MS-ADTS 3.1.1.2.3.1, this allows specifying the OID
1.2.840.113556.1.2.50 as the linkID of a new linked attribute in the
schema in order to automatically assign it an unused even linkID.

Specifying the attributeID or ldapDisplayName of an existing forward
link will now also add the new linked attribute as the backlink of that
existing link.

This also prevents adding duplicate linkIDs. Previously, we could run
into issues when trying to delete backlinks with duplicate linkIDs.

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11139
source4/dsdb/samdb/ldb_modules/samldb.c