Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Attribute uniqueness plugin monitors specified attributes and ensures, that newly added entries have unique values for the monitored attributes. One example is attribute uid - if user tries to add new entry with uid equal to uid of already existing entry, the addition operation is refused by DS.
It is possible to configure Attribute Uniqueness plugin and still add entry with duplicate attribute. Below are steps for case when 'sn' attribute is being monitored.
Version-Release number of selected component (if applicable):
389-ds-base-1.2.11.15-29.el6.x86_64 (RHEL64)
389-ds-base-1.3.1.6-8.el7.x86_64 (RHEL7)
How reproducible:
always
Steps to Reproduce:
1. Delete sn index:
ldapdelete -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 "cn=sn,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config"
2. Configure attribute uniqueness on sn attribute:
ldapmodify -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 -a <<EOF
dn: cn=attribute uniqueness,cn=plugins,cn=config
changetype: modify
replace: nsslapd-pluginEnabled
nsslapd-pluginEnabled: on
-
replace: nsslapd-pluginarg0
nsslapd-pluginarg0: sn
-
replace: nsslapd-pluginarg1
nsslapd-pluginarg1: dc=example,dc=com
EOF
3. Add user:
ldapmodify -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 -a <<EOF
dn: cn=tuser1,ou=people,dc=example,dc=com
objectclass: person
objectclass: top
sn: tuser1
cn: tuser1
EOF
4. Restart server
5. Add user with value 'sn' equal to value of sn of cn=tuser1:
ldapmodify -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 -a <<EOF
dn: cn=tuser2,ou=people,dc=example,dc=com
objectclass: person
objectclass: top
sn: tuser1
cn: tuser2
EOF
Actual results:
ldapsearch -LLL -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 -b "cn=tuser1,ou=people,dc=example,dc=com" sn
dn: cn=tuser1,ou=People,dc=example,dc=com
sn: tuser1
ldapsearch -LLL -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 -b "cn=tuser2,ou=people,dc=example,dc=com" sn
dn: cn=tuser2,ou=People,dc=example,dc=com
sn: tuser1
ldapsearch -LLL -h $HOST -p $PORT -D "cn=directory manager" -w Secret123 -b "cn=attribute uniqueness,cn=plugins,cn=config"
dn: cn=attribute uniqueness,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: attribute uniqueness
nsslapd-pluginPath: libattr-unique-plugin
nsslapd-pluginInitfunc: NSUniqueAttr_Init
nsslapd-pluginType: betxnpreoperation
nsslapd-pluginEnabled: on
nsslapd-pluginarg0: sn
nsslapd-pluginarg1: dc=example,dc=com
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: NSUniqueAttr
nsslapd-pluginVersion: 1.3.1.6
nsslapd-pluginVendor: 389 Project
nsslapd-pluginDescription: Enforce unique attribute values
Expected results:
Addition of cn=tuser2 should be refused by Attribute Uniqueness plugin.
Additional info:
When steps 3 and 4 are reversed, i.e. instance is first restarted, then user cn=tuser1 added, then addition of cn=tuser2 is refused with:
adding new entry "cn=tuser2,ou=people,dc=example,dc=com"
ldap_add: Constraint violation (19)
additional info: Another entry with the same attribute value already exists (attribute: "sn")
Comment 2RHEL Program Management
2013-12-01 22:25:07 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
The issue is that the index that is removed (sn) is a default index. So at the next restart that index is automatically recreated by the backend. So when the next add takes place there is an "sn" index to use, but it's empty. The server uses this index to find any matching entries, but none are found because it's empty. This allows the duplicate "sn" valued entry to be added. Removing the default index configuration at the same time the backend index is deleted achieves the desired results.
To correctly remove a default user index, it must also be deleted from the default index branch of cn=config:
[1] ldapdelete -h $HOST -p $PORT -D "cn=directory manager" -w Secret123
"cn=sn,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config"
[2] ldapdelete -h $HOST -p $PORT -D "cn=directory manager" -w Secret123
"cn=sn,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config"
This will not be fixed in the core server, instead a doc bug has been filed to document the correct way to remove an default user index.
https://bugzilla.redhat.com/show_bug.cgi?id=1108356