From 17078a46b899c8af2f38479391094a0b2b1a3d5b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 24 Apr 2007 05:57:56 +0000 Subject: r22497: Support renaming objectclasses and attributes for the LDAP backend. OpenLDAP is fussy about operational attributes in user-supplied schema. Andrew Bartlett (This used to be commit d7cd4b768a7f56ced8ed94b9a63d01865ba7d10a) --- source4/dsdb/samdb/ldb_modules/entryUUID.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/entryUUID.c b/source4/dsdb/samdb/ldb_modules/entryUUID.c index 3196069fa8..314e44111a 100644 --- a/source4/dsdb/samdb/ldb_modules/entryUUID.c +++ b/source4/dsdb/samdb/ldb_modules/entryUUID.c @@ -351,6 +351,15 @@ const struct ldb_map_attribute entryUUID_attributes[] = } } }, + { + .local_name = "objectClasses", + .type = MAP_RENAME, + .u = { + .rename = { + .remote_name = "sambaObjectClasses" + } + } + }, { .local_name = "sambaPassword", .type = MAP_RENAME, @@ -446,9 +455,21 @@ const struct ldb_map_attribute entryUUID_attributes[] = } }; +/* This objectClass conflicts with builtin classes on OpenLDAP */ +const struct ldb_map_objectclass entryUUID_objectclasses[] = +{ + { + .local_name = "subSchema", + .remote_name = "samba4SubSchema" + }, + { + .local_name = NULL + } +}; + /* These things do not show up in wildcard searches in OpenLDAP, but * we need them to show up in the AD-like view */ -const char * const wildcard_attributes[] = { +const char * const entryUUID_wildcard_attributes[] = { "objectGUID", "whenCreated", "whenChanged", @@ -471,7 +492,7 @@ const struct ldb_map_attribute nsuniqueid_attributes[] = }, }, }, - /* objectSid */ + /* objectSid */ { .local_name = "objectSid", .type = MAP_CONVERT, @@ -751,7 +772,7 @@ static int entryUUID_init(struct ldb_module *module) struct entryUUID_private *entryUUID_private; struct ldb_dn *schema_dn; - ret = ldb_map_init(module, entryUUID_attributes, NULL, wildcard_attributes, NULL); + ret = ldb_map_init(module, entryUUID_attributes, entryUUID_objectclasses, entryUUID_wildcard_attributes, NULL); if (ret != LDB_SUCCESS) return ret; -- cgit