diff options
author | CrÃstian Deives <cristiandeives@gmail.com> | 2009-11-19 16:03:59 -0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-11-20 14:39:01 +1100 |
commit | 1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be (patch) | |
tree | 5eb2495a43fc271c05d363ede0a7496169d2f6ee /source4/lib/ldb/ldb_map | |
parent | f3f0c8e2ce9fe315848d15eeb289eae9fb525a3a (diff) | |
download | samba-1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be.tar.gz samba-1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be.tar.bz2 samba-1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be.zip |
added new function "ldb_msg_add_dn"
a helper function to a DN element to an ldb_msg using ldb_msg_add_string.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/lib/ldb/ldb_map')
-rw-r--r-- | source4/lib/ldb/ldb_map/ldb_map_inbound.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source4/lib/ldb/ldb_map/ldb_map_inbound.c b/source4/lib/ldb/ldb_map/ldb_map_inbound.c index 5a237ef28c..11ec9d2ced 100644 --- a/source4/lib/ldb/ldb_map/ldb_map_inbound.c +++ b/source4/lib/ldb/ldb_map/ldb_map_inbound.c @@ -362,7 +362,6 @@ int map_add(struct ldb_module *module, struct ldb_request *req) struct ldb_context *ldb; struct map_context *ac; struct ldb_message *remote_msg; - const char *dn; int ret; ldb = ldb_module_get_ctx(module); @@ -426,8 +425,7 @@ int map_add(struct ldb_module *module, struct ldb_request *req) /* Store remote DN in 'IS_MAPPED' */ /* TODO: use GUIDs here instead */ - dn = ldb_dn_alloc_linearized(ac->local_msg, remote_msg->dn); - if (ldb_msg_add_string(ac->local_msg, IS_MAPPED, dn) != 0) { + if (ldb_msg_add_dn(ac->local_msg, IS_MAPPED, remote_msg->dn) != 0) { return LDB_ERR_OPERATIONS_ERROR; } @@ -545,7 +543,6 @@ static int map_modify_do_local(struct map_context *ac) { struct ldb_request *local_req; struct ldb_context *ldb; - char *dn; int ret; ldb = ldb_module_get_ctx(ac->module); @@ -558,9 +555,8 @@ static int map_modify_do_local(struct map_context *ac) LDB_FLAG_MOD_ADD, NULL) != 0) { return LDB_ERR_OPERATIONS_ERROR; } - dn = ldb_dn_alloc_linearized(ac->local_msg, - ac->remote_req->op.mod.message->dn); - if (ldb_msg_add_string(ac->local_msg, IS_MAPPED, dn) != 0) { + if (ldb_msg_add_dn(ac->local_msg, IS_MAPPED, + ac->remote_req->op.mod.message->dn) != 0) { return LDB_ERR_OPERATIONS_ERROR; } |