Issue 9077 - slapo-unique spins its wheels on a non-trivial olcUniqueURI spec
Summary: slapo-unique spins its wheels on a non-trivial olcUniqueURI spec
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.48
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
: 8479 (view as issue list)
Depends on:
Blocks:
 
Reported: 2019-09-13 15:34 UTC by gray@nxg.name
Modified: 2021-01-25 21:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description gray@nxg.name 2019-09-13 15:34:03 UTC
Full_Name: Norman Gray
Version: 2.4.48
OS: FreeBSD 12.0
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (130.209.45.140)


A plausible-looking spec in olcUniqueURI causes slapadd to spin its wheels
indefinitely.

I want to specify something like:

    dn: olcOverlay=unique,olcDatabase={1}mdb,cn=config
    objectClass: olcOverlayConfig
    objectClass: olcUniqueConfig
    olcOverlay: unique
    olcUniqueURI: ldap:///ou=dept-A,o=example?uidnumber?sub
      ldap:///ou=dept-B,o=example?uidnumber?sub

If I do this, however, then slapadd spins its wheels when the `slapd.ldif` is
loaded into an otherwise empty configuration (ie, this happens at configuration
time, before any records/objects are loaded):

    $ rm -R /usr/local/etc/openldap/slapd.d/*
    $ su -m ldap -c "slapadd -d255 -n 0 -F /usr/local/etc/openldap/slapd.d -l
/usr/local/etc/openldap/slapd.ldif"
    ...
    ...
    5d77d377 >>> dnPrettyNormal:
<olcOverlay=unique,olcDatabase={1}mdb,cn=config>
    5d77d377 <<< dnPrettyNormal:
<olcOverlay=unique,olcDatabase={1}mdb,cn=config>,
<olcOverlay=unique,olcDatabase={1}mdb,cn=config>
    5d77d377 <= str2entry(olcOverlay=unique,olcDatabase={1}mdb,cn=config) ->
0x800d4eca8
    5d77d377 oc_check_required entry
(olcOverlay=unique,olcDatabase={1}mdb,cn=config), objectClass "olcUniqueConfig"
    5d77d377 oc_check_allowed type "objectClass"
    5d77d377 oc_check_allowed type "olcOverlay"
    5d77d377 oc_check_allowed type "olcUniqueURI"
    5d77d377 oc_check_allowed type "structuralObjectClass"
    5d77d377 >>> dnNormalize: <olcOverlay={1}unique>
    5d77d377 <<< dnNormalize: <olcOverlay={1}unique>
    5d77d377 ==> unique_db_init
    5d77d377 ==> unique_new_domain <ldap:///ou=dept-A,o=example?uidnumber?sub
ldap:///ou=dept-B,o=example?uidnumber?sub>
    5d77d377 >>> dnPrettyNormal: <ou=dept-A,o=example>
    5d77d377 <<< dnPrettyNormal: <ou=dept-A,o=example>, <ou=dept-A,o=example>
    5d77d377 >>> dnPrettyNormal: <ou=dept-B,o=example>
    5d77d377 <<< dnPrettyNormal: <ou=dept-B,o=example>, <ou=dept-B,o=example>
    5d77d377 >>> dnPrettyNormal: <ou=dept-B,o=example>
    5d77d377 <<< dnPrettyNormal: <ou=dept-B,o=example>, <ou=dept-B,o=example>
    5d77d377 >>> dnPrettyNormal: <ou=dept-B,o=example>
    5d77d377 <<< dnPrettyNormal: <ou=dept-B,o=example>, <ou=dept-B,o=example>
    5d77d377 >>> dnPrettyNormal: <ou=dept-B,o=example>
    5d77d377 <<< dnPrettyNormal: <ou=dept-B,o=example>, <ou=dept-B,o=example>
    5d77d377 >>> dnPrettyNormal: <ou=dept-B,o=example>
    5d77d377 <<< dnPrettyNormal: <ou=dept-B,o=example>, <ou=dept-B,o=example>
    ...
    ^C

and so on and on and on, apparently indefinitely.

The idea is that the uidnumber attribute should be unique across the two OUs,
ou=dept-A and ou=dept-B.  Whether or not this is a valid spec is another issue;
even if it's invalid, it shouldn't cause this behaviour; if the spec is invalid,
it should produce a terminal error.

Looking at the code in servers/slapd/overlays/unique.c, nothing leaps out as an
obvious error (ie, I'm not claiming I have a fix for this).

There was a brief thread about this on openldap-technical:
<https://www.openldap.org/lists/openldap-technical/201909/msg00031.html>

Configuration:

# /usr/local/libexec/slapd -VVV     
@(#) $OpenLDAP: slapd 2.4.48 (Sep 10 2019 13:30:19) $
	root@hermite.physics.gla.ac.uk:/var/ports/usr/ports/net/openldap24-server/work/openldap-2.4.48/servers/slapd

Included static overlays:
    constraint
    syncprov
    unique
Included static backends:
    config
    ldif
    relay
# freebsd-version
12.0-RELEASE-p9

This is the most recent currently-packaged version of OpenLDAP on FreeBSD.
Comment 1 Quanah Gibson-Mount 2019-09-13 17:33:37 UTC

--On Friday, September 13, 2019 4:34 PM +0000 gray@nxg.name wrote:

> Full_Name: Norman Gray
> Version: 2.4.48
> OS: FreeBSD 12.0
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (130.209.45.140)

Unrelated side note, ITS number fixed to be 9077.

--Quanah

--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>

Comment 2 Quanah Gibson-Mount 2019-11-21 20:31:21 UTC
changed notes
changed state Open to Release
moved from Incoming to Software Bugs
Comment 3 OpenLDAP project 2020-01-30 18:33:13 UTC
Fixed in master
Fixed in RE24 (2.4.49)
Comment 4 Quanah Gibson-Mount 2020-01-30 18:33:13 UTC
changed notes
changed state Release to Closed
Comment 5 Ondřej Kuzník 2020-03-31 08:04:23 UTC
*** Issue 8479 has been marked as a duplicate of this issue. ***