diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-07-24 14:26:30 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-07-24 14:26:30 +1000 |
commit | 66f09a7fd121cf7857b45dabc4fcaf32ae543552 (patch) | |
tree | f3dceee89ab41e1a3dc78849c9b57839000c77d3 /source4/lib | |
parent | 2ecda9fde4aa00aecd6df6ebeb162d173853d146 (diff) | |
parent | 05583308fe8278f1bc0c815e23cf5e470a81e12f (diff) | |
download | samba-66f09a7fd121cf7857b45dabc4fcaf32ae543552.tar.gz samba-66f09a7fd121cf7857b45dabc4fcaf32ae543552.tar.bz2 samba-66f09a7fd121cf7857b45dabc4fcaf32ae543552.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 24309dbf4d9622fcfafa29ef98bc0459fdaa814b)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/ldb_map/ldb_map.c | 5 | ||||
-rwxr-xr-x | source4/lib/ldb/tests/python/ldap.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source4/lib/ldb/ldb_map/ldb_map.c b/source4/lib/ldb/ldb_map/ldb_map.c index 9c189feb11..b3f639dc67 100644 --- a/source4/lib/ldb/ldb_map/ldb_map.c +++ b/source4/lib/ldb/ldb_map/ldb_map.c @@ -810,6 +810,7 @@ static struct ldb_val map_objectclass_convert_remote(struct ldb_module *module, /* Generate a local message with a mapped objectClass. */ static struct ldb_message_element *map_objectclass_generate_local(struct ldb_module *module, void *mem_ctx, const char *local_attr, const struct ldb_message *remote) { + const struct ldb_map_context *data = map_get_context(module); struct ldb_message_element *el, *oc; struct ldb_val val; int i; @@ -844,10 +845,10 @@ static struct ldb_message_element *map_objectclass_generate_local(struct ldb_mod el->values[i] = map_objectclass_convert_remote(module, el->values, &oc->values[i]); } - val.data = (uint8_t *)talloc_strdup(el->values, "extensibleObject"); + val.data = (uint8_t *)talloc_strdup(el->values, data->add_objectclass); val.length = strlen((char *)val.data); - /* Remove last value if it was "extensibleObject" */ + /* Remove last value if it was the string in data->add_objectclass (eg samba4top, extensibleObject) */ if (ldb_val_equal_exact(&val, &el->values[i-1])) { el->num_values--; el->values = talloc_realloc(el, el->values, struct ldb_val, el->num_values); diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index 0dc514aeaf..042469602c 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -579,7 +579,7 @@ member: cn=ldaptestuser4,cn=ldaptestcontainer,""" + self.base_dn + """ self.assertEquals(str(res[0].dn), ("CN=ldaptestuser4,CN=ldaptestcontainer2," + self.base_dn)) self.assertEquals(res[0]["memberOf"][0].upper(), ("CN=ldaptestgroup2,CN=Users," + self.base_dn).upper()) - time.sleep(2) + time.sleep(4) print "Testing ldb.search for (&(member=CN=ldaptestuser4,CN=ldaptestcontainer2," + self.base_dn + ")(objectclass=group)) to check subtree renames and linked attributes" res = ldb.search(self.base_dn, expression="(&(member=CN=ldaptestuser4,CN=ldaptestcontainer2," + self.base_dn + ")(objectclass=group))", scope=SCOPE_SUBTREE) @@ -835,7 +835,7 @@ member: CN=ldaptestutf8user èùéìòà,CN=Users,""" + self.base_dn + """ ldb.delete(("CN=ldaptestuser2,CN=Users," + self.base_dn)) - time.sleep(2) + time.sleep(4) attrs = ["cn", "name", "objectClass", "objectGUID", "whenCreated", "nTSecurityDescriptor", "member"] print "Testing ldb.search for (&(cn=ldaptestgroup2)(objectClass=group)) to check linked delete" |