diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-03-04 13:40:50 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-03-04 13:40:50 +1100 |
commit | 8a10979e6b5baaf9d4ef1703f056cdae6a81cf0e (patch) | |
tree | 0e8fd2cc2a729e3d38246ab4af8de97731d8172b /source4/dsdb/samdb/ldb_modules/simple_ldap_map.c | |
parent | 736ae6a56653a8d20f57a7b8a6221eb45dba720c (diff) | |
download | samba-8a10979e6b5baaf9d4ef1703f056cdae6a81cf0e.tar.gz samba-8a10979e6b5baaf9d4ef1703f056cdae6a81cf0e.tar.bz2 samba-8a10979e6b5baaf9d4ef1703f056cdae6a81cf0e.zip |
The DN in objectCategory should, if possible, be returned pretty...
This avoids going via the canonicalise_fn(), which will upper case the DN
Andrew Bartlett
(This used to be commit cdff1b0802437d713652b89f4522d3cce97c30ec)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/simple_ldap_map.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/simple_ldap_map.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c index 3f4c19d285..91896d7247 100644 --- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c +++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c @@ -153,9 +153,17 @@ static struct ldb_val sid_always_binary(struct ldb_module *module, TALLOC_CTX *c /* Ensure we always convert objectCategory into a DN */ static struct ldb_val objectCategory_always_dn(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val) { + struct ldb_dn *dn; struct ldb_val out = data_blob(NULL, 0); const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(module->ldb, "objectCategory"); + dn = ldb_dn_new(ctx, module->ldb, val->data); + if (dn && ldb_dn_is_valid(dn)) { + talloc_free(dn); + return val_copy(module, ctx, val); + } + talloc_free(dn); + if (a->syntax->canonicalise_fn(module->ldb, ctx, val, &out) != LDB_SUCCESS) { return data_blob(NULL, 0); } |