diff options
author | Simo Sorce <idra@samba.org> | 2006-11-22 02:05:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:22 -0500 |
commit | a9e31b33b55a873c2f01db5e348560176adf863d (patch) | |
tree | 603f4cb99999eea881f6092fb6cbbbcb8daca184 /source4/lib/ldb/modules/ldb_map.c | |
parent | 4889eb9f7aae9349e426d0f6d2217adff67eaebd (diff) | |
download | samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.gz samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.bz2 samba-a9e31b33b55a873c2f01db5e348560176adf863d.zip |
r19832: better prototypes for the linearization functions:
- ldb_dn_get_linearized
returns a const string
- ldb_dn_alloc_linearized
allocs astring with the linearized dn
(This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
Diffstat (limited to 'source4/lib/ldb/modules/ldb_map.c')
-rw-r--r-- | source4/lib/ldb/modules/ldb_map.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/ldb/modules/ldb_map.c b/source4/lib/ldb/modules/ldb_map.c index 05a0459b4a..6387ffc5b7 100644 --- a/source4/lib/ldb/modules/ldb_map.c +++ b/source4/lib/ldb/modules/ldb_map.c @@ -679,7 +679,7 @@ static struct ldb_val ldb_dn_convert_local(struct ldb_module *module, void *mem_ talloc_free(dn); newval.length = 0; - newval.data = (uint8_t *)ldb_dn_linearize(mem_ctx, newdn); + newval.data = (uint8_t *)ldb_dn_alloc_linearized(mem_ctx, newdn); if (newval.data) { newval.length = strlen((char *)newval.data); } @@ -705,7 +705,7 @@ static struct ldb_val ldb_dn_convert_remote(struct ldb_module *module, void *mem talloc_free(dn); newval.length = 0; - newval.data = (uint8_t *)ldb_dn_linearize(mem_ctx, newdn); + newval.data = (uint8_t *)ldb_dn_alloc_linearized(mem_ctx, newdn); if (newval.data) { newval.length = strlen((char *)newval.data); } @@ -992,9 +992,9 @@ struct ldb_request *map_build_fixup_req(struct map_context *ac, struct ldb_dn *o } /* Update local 'IS_MAPPED' to the new remote DN */ - msg->dn = discard_const_p(struct ldb_dn, olddn); - dn = ldb_dn_linearize(msg, newdn); - if (dn == NULL) { + msg->dn = ldb_dn_copy(msg, olddn); + dn = ldb_dn_alloc_linearized(msg, newdn); + if ( ! dn || ! ldb_dn_validate(msg->dn)) { goto failed; } if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_REPLACE, NULL) != 0) { |