mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s4-ldb: changed ldb_msg_add_dn() to ldb_msg_add_linearized_dn()
this makes the usage clearer Signed-off-by: Andrew Tridgell <tridge@samba.org>
This commit is contained in:
parent
7ca2ceb333
commit
bed9efa6cd
@ -377,9 +377,9 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares,
|
||||
ret = ldb_msg_add_steal_string(ares->message, "distinguishedName",
|
||||
ldb_dn_get_extended_linearized(ares->message, ares->message->dn, ac->extended_type));
|
||||
} else {
|
||||
ret = ldb_msg_add_dn(ares->message,
|
||||
"distinguishedName",
|
||||
ares->message->dn);
|
||||
ret = ldb_msg_add_linearized_dn(ares->message,
|
||||
"distinguishedName",
|
||||
ares->message->dn);
|
||||
}
|
||||
if (ret != LDB_SUCCESS) {
|
||||
ldb_oom(ldb);
|
||||
|
@ -263,10 +263,11 @@ int ldb_msg_add_steal_string(struct ldb_message *msg,
|
||||
WARNING: this uses the linearized string from the dn, and does not
|
||||
copy the string.
|
||||
*/
|
||||
int ldb_msg_add_dn(struct ldb_message *msg, const char *attr_name,
|
||||
struct ldb_dn *dn)
|
||||
int ldb_msg_add_linearized_dn(struct ldb_message *msg, const char *attr_name,
|
||||
struct ldb_dn *dn)
|
||||
{
|
||||
return ldb_msg_add_string(msg, attr_name, ldb_dn_get_linearized(dn));
|
||||
return ldb_msg_add_steal_string(msg, attr_name,
|
||||
ldb_dn_alloc_linearized(msg, dn));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1776,8 +1776,8 @@ int ldb_msg_add_steal_string(struct ldb_message *msg,
|
||||
const char *attr_name, char *str);
|
||||
int ldb_msg_add_string(struct ldb_message *msg,
|
||||
const char *attr_name, const char *str);
|
||||
int ldb_msg_add_dn(struct ldb_message *msg, const char *attr_name,
|
||||
struct ldb_dn *dn);
|
||||
int ldb_msg_add_linearized_dn(struct ldb_message *msg, const char *attr_name,
|
||||
struct ldb_dn *dn);
|
||||
int ldb_msg_add_fmt(struct ldb_message *msg,
|
||||
const char *attr_name, const char *fmt, ...) PRINTF_ATTRIBUTE(3,4);
|
||||
|
||||
|
@ -425,7 +425,9 @@ int map_add(struct ldb_module *module, struct ldb_request *req)
|
||||
|
||||
/* Store remote DN in 'IS_MAPPED' */
|
||||
/* TODO: use GUIDs here instead */
|
||||
if (ldb_msg_add_dn(ac->local_msg, IS_MAPPED, remote_msg->dn) != 0) {
|
||||
ret = ldb_msg_add_linearized_dn(ac->local_msg, IS_MAPPED,
|
||||
remote_msg->dn);
|
||||
if (ret != LDB_SUCCESS) {
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
@ -555,8 +557,9 @@ static int map_modify_do_local(struct map_context *ac)
|
||||
LDB_FLAG_MOD_ADD, NULL) != 0) {
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
if (ldb_msg_add_dn(ac->local_msg, IS_MAPPED,
|
||||
ac->remote_req->op.mod.message->dn) != 0) {
|
||||
ret = ldb_msg_add_linearized_dn(ac->local_msg, IS_MAPPED,
|
||||
ac->remote_req->op.mod.message->dn);
|
||||
if (ret != 0) {
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user