[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: SQL backend questions the sequel

> Hi all,
> Is this the procedure slapd follows to add a LDAP entry?
> 1. Determine the objectClass of the entry to add.
> 2. Call the stored procedure "create_proc" from the ldap_attr_mappings
> table to create an instance of objectClass. (BTW: should this procedure
> return the id for the instance of objectClass??? This is not in the docs
> but all the samples do this) 3. Insert the created instance of
> objectClass in the ldap_entries table using the query as determined in
> the slapd.conf insentry_query 4. For each attribute of the instance of
> objectClass call the stored procedure "add_proc" from the
> ldap_attr_mappings

I'm talking about 2.2.X (2.2.11 at present).

- slapd uses the structuralObjectClass of the entry to look up the
objectClass mapping according to ldap_oc_mappings;
- it does some sanity checks (I'll discuss these later)
- it checks for the existence of the entry's parent
- it uses the ldap_oc_mappings create_proc to create the objectClass
entry in ldap_entries
- then, for each attribute, the corresponding values are inserted if
possible.  I'll discuss later how to decide whether an add should succeed
or not if some (required?) attribute mapping is not available; now I
really have to go :)

On another note, in the previous answer, I said that slapd ignores the
return values of create operations, when requested.  That is only
partially correct.  It expects create to return the key of the created
entry; if none is returned, a special select is required to fetch the key
of the created entry.  In the meanwhile, the newly created entry should
not be visible to other requesters because its creation has not been
committed yet.  I haven't found it out, yet, but for some strange reason
my postgres/ODBC combination for some reason (some sort of default
autocommit?) right after creation makes the newly created dangling entry,
with no attributes yet, visible to other connections.  This is very nasty.

Pierangelo Masarati

    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497