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

ldap_entry_objclasses and attribute mappings with back-sql



Hi,

Somehow i am not able to return custom attributes for classes defined as
ldap_entry_objclasses with back-sql.

I.e. assumed i would like to add the class posixAccount to the
inetOrgPerson "Mitya Kovalev" in the examples provided in
rdbms_depend/pgsql. What is the correct way to do this?

IMO (if i understand the docs right) i first have to define
ldap_oc_mappings for "posixAccount" and then define the attributes of
posixAccount in ldap_attr_mappings.

After this i add an entry for "Mitya Kovalev" in ldap_entry_objclasses
with his id and "posixAccount" as oc_name.

If i do this, the additional "posixAccount" objectClass is listed for
"Mitya Kovalev", but the additional attributes aren't listed.

The other method which i tried (and which IMO is the wrong one) is
defining the attributes for posixAccount for the objectClass of
inetOrgPerson instead of posixAccount.

On the first impression this works, however it isn't possible to do some
searches for this object anymore.

e.g.
> ldapsearch -b "o=sql,c=RU"
> ldapsearch -b "o=sql,c=RU" "(objectClass=posixAccount)"
> ldapsearch -b "o=sql,c=RU" uid
correctly lists "Mitya Kovalev".

however:
> ldapsearch -b "o=sql,c=RU" "(objectClass=posixAccount)" uid
doesn't list any entry at all.

Any suggestions how I can get this to work? (I am using
OPENLDAP_REL_ENG_2_2.)

I have attached the SQL modifications for the 2 methods I described
above to this mail.

cu
/gst

####### Method 1 ########

# Create new posixAccount mapping
INSERT INTO ldap_oc_mappings
(id,name,keytbl,keycol,create_proc,delete_proc,expect_return) VALUES
(101,'posixAccount','persons','id',NULL,NULL,0);

# Define Attributes for posixAccount
INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (101, 101, 'uid', 'persons.name' , 'persons' ,NULL ,NULL, NULL,3,0);

INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (102, 101, 'uidNumber', '2000' , 'persons' ,NULL ,NULL, NULL,3,0);

INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (103, 101, 'gidNumber', '2000' , 'persons' ,NULL ,NULL, NULL,3,0);

INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (104, 101, 'homeDirectory', 'persons.name' , 'persons' ,NULL ,NULL, NULL,3,0);

# Mitya Kovalev (ldap_entries.id = 2) should have the additional objectClass posixAccount
INSERT INTO ldap_entry_objclasses (entry_id, oc_name) VALUES (2, 'posixAccount');


####### Method 2 ########

# Create new posixAccount mapping
INSERT INTO ldap_oc_mappings
(id,name,keytbl,keycol,create_proc,delete_proc,expect_return) VALUES
(101,'posixAccount','persons','id',NULL,NULL,0);

# Define Attributes for posixAccount
INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (101, 1, 'uid', 'persons.name' , 'persons' ,NULL ,NULL, NULL,3,0);

INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (102, 1, 'uidNumber', '2000' , 'persons' ,NULL ,NULL, NULL,3,0);

INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (103, 1, 'gidNumber', '2000' , 'persons' ,NULL ,NULL, NULL,3,0);

INSERT INTO ldap_attr_mappings
(id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
VALUES (104, 1, 'homeDirectory', 'persons.name' , 'persons' ,NULL ,NULL, NULL,3,0);

# Mitya Kovalev (ldap_entries.id = 2) should have the additional objectClass posixAccount
INSERT INTO ldap_entry_objclasses (entry_id, oc_name) VALUES (2, 'posixAccount');

Attachment: signature.asc
Description: This is a digitally signed message part