summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/entryUUID.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn.c12
-rw-r--r--source4/dsdb/samdb/ldb_modules/local_password.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/proxy.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c10
7 files changed, 18 insertions, 20 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/entryUUID.c b/source4/dsdb/samdb/ldb_modules/entryUUID.c
index 2bc97f2040..42aa53ca64 100644
--- a/source4/dsdb/samdb/ldb_modules/entryUUID.c
+++ b/source4/dsdb/samdb/ldb_modules/entryUUID.c
@@ -122,7 +122,7 @@ static struct ldb_val objectCategory_always_dn(struct ldb_module *module, TALLOC
for (i=0; list && (i < list->count); i++) {
if (ldb_attr_cmp((const char *)val->data, ldb_msg_find_attr_as_string(list->msgs[i], "lDAPDisplayName", NULL)) == 0) {
- char *dn = ldb_dn_linearize(ctx, list->msgs[i]->dn);
+ char *dn = ldb_dn_alloc_linearized(ctx, list->msgs[i]->dn);
return data_blob_string_const(dn);
}
}
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn.c b/source4/dsdb/samdb/ldb_modules/extended_dn.c
index 012ac74514..a571857bbb 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn.c
@@ -107,11 +107,7 @@ static BOOL inject_extended_dn(struct ldb_message *msg,
struct dom_sid *sid;
char *object_guid;
char *object_sid;
- char *new_dn, *dn;
-
- dn = ldb_dn_linearize(msg, msg->dn);
- if (!dn)
- return False;
+ char *new_dn;
/* retrieve object_guid */
guid = samdb_result_guid(msg, "objectGUID");
@@ -140,10 +136,12 @@ static BOOL inject_extended_dn(struct ldb_message *msg,
case 1:
if (object_sid) {
new_dn = talloc_asprintf(msg, "<GUID=%s>;<SID=%s>;%s",
- object_guid, object_sid, dn);
+ object_guid, object_sid,
+ ldb_dn_get_linearized(msg->dn));
} else {
new_dn = talloc_asprintf(msg, "<GUID=%s>;%s",
- object_guid, dn);
+ object_guid,
+ ldb_dn_get_linearized(msg->dn));
}
break;
default:
diff --git a/source4/dsdb/samdb/ldb_modules/local_password.c b/source4/dsdb/samdb/ldb_modules/local_password.c
index 57323d859f..9e1cdd32b3 100644
--- a/source4/dsdb/samdb/ldb_modules/local_password.c
+++ b/source4/dsdb/samdb/ldb_modules/local_password.c
@@ -160,7 +160,7 @@ static int local_password_add(struct ldb_module *module, struct ldb_request *req
if (!ldb_msg_check_string_attribute(req->op.add.message, "objectClass", "person")) {
ldb_asprintf_errstring(module->ldb,
"Cannot relocate a password on entry: %s, does not have objectClass 'person'",
- ldb_dn_linearize(req, req->op.add.message->dn));
+ ldb_dn_get_linearized(req->op.add.message->dn));
return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
@@ -428,7 +428,7 @@ static int local_password_mod_local(struct ldb_handle *h) {
if (!ac->search_res) {
ldb_asprintf_errstring(ac->module->ldb,
"entry just modified (%s) not found!",
- ldb_dn_linearize(ac, ac->remote_req->op.mod.message->dn));
+ ldb_dn_get_linearized(ac->remote_req->op.mod.message->dn));
return LDB_ERR_OPERATIONS_ERROR;
}
if (!ldb_msg_check_string_attribute(ac->search_res->message, "objectClass", "person")) {
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index b25beb7a8f..38a44bdae2 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -160,7 +160,7 @@ static int add_krb5_keys_from_password(struct ldb_module *module, struct ldb_mes
ldb_asprintf_errstring(module->ldb,
"password_hash_handle: "
"generation of new kerberos keys failed: %s is a computer without a samAccountName",
- ldb_dn_linearize(msg, msg->dn));
+ ldb_dn_get_linearized(msg->dn));
return LDB_ERR_OPERATIONS_ERROR;
}
if (name[strlen(name)-1] == '$') {
@@ -191,7 +191,7 @@ static int add_krb5_keys_from_password(struct ldb_module *module, struct ldb_mes
ldb_asprintf_errstring(module->ldb,
"password_hash_handle: "
"generation of new kerberos keys failed: %s has no samAccountName",
- ldb_dn_linearize(msg, msg->dn));
+ ldb_dn_get_linearized(msg->dn));
return LDB_ERR_OPERATIONS_ERROR;
}
krb5_ret = krb5_make_principal(smb_krb5_context->krb5_context,
diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c
index 41fe8b68c9..0dd5ee1e3d 100644
--- a/source4/dsdb/samdb/ldb_modules/proxy.c
+++ b/source4/dsdb/samdb/ldb_modules/proxy.c
@@ -285,7 +285,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
ldb_dn_add_base(base, proxy->olddn);
ldb_debug(module->ldb, LDB_DEBUG_FATAL, "proxying: '%s' with dn '%s' \n",
- ldb_filter_from_tree(proxy, newreq->op.search.tree), ldb_dn_linearize(proxy, newreq->op.search.base));
+ ldb_filter_from_tree(proxy, newreq->op.search.tree), ldb_dn_get_linearized(newreq->op.search.base));
for (i = 0; req->op.search.attrs && req->op.search.attrs[i]; i++) {
ldb_debug(module->ldb, LDB_DEBUG_FATAL, "attr: '%s'\n", req->op.search.attrs[i]);
}
@@ -313,7 +313,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
failed:
ldb_debug(module->ldb, LDB_DEBUG_TRACE, "proxy failed for %s\n",
- ldb_dn_linearize(proxy, req->op.search.base));
+ ldb_dn_get_linearized(req->op.search.base));
passthru:
return ldb_next_request(module, req);
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index e073c8f89b..86e97f9cfb 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -86,7 +86,7 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms
for (i = 0; i < priv->num_partitions; i++) {
struct ldb_dn *dn = priv->partitions[i];
if (ldb_msg_add_steal_string(msg, "namingContexts",
- ldb_dn_linearize(msg, dn)) != 0) {
+ ldb_dn_alloc_linearized(msg, dn)) != 0) {
goto failed;
}
}
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 667b0d5ca8..c62c7dcf71 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -139,7 +139,7 @@ static int samldb_find_next_rid(struct ldb_module *module, TALLOC_CTX *mem_ctx,
if (str == NULL) {
ldb_asprintf_errstring(module->ldb,
"attribute nextRid not found in %s\n",
- ldb_dn_linearize(res, dn));
+ ldb_dn_get_linearized(dn));
talloc_free(res);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -239,7 +239,7 @@ static int samldb_get_new_sid(struct ldb_module *module,
if (dom_dn == NULL) {
ldb_asprintf_errstring(module->ldb,
"Invalid dn (%s) not child of a domain object!\n",
- ldb_dn_linearize(mem_ctx, obj_dn));
+ ldb_dn_get_linearized(obj_dn));
return LDB_ERR_CONSTRAINT_VIOLATION;
}
@@ -249,7 +249,7 @@ static int samldb_get_new_sid(struct ldb_module *module,
if (ret != LDB_SUCCESS) {
ldb_asprintf_errstring(module->ldb,
"samldb_get_new_sid: error retrieving domain sid from %s: %s!\n",
- ldb_dn_linearize(mem_ctx, dom_dn),
+ ldb_dn_get_linearized(dom_dn),
ldb_errstring(module->ldb));
talloc_free(res);
return ret;
@@ -258,7 +258,7 @@ static int samldb_get_new_sid(struct ldb_module *module,
if (res->count != 1) {
ldb_asprintf_errstring(module->ldb,
"samldb_get_new_sid: error retrieving domain sid from %s: not found!\n",
- ldb_dn_linearize(mem_ctx, dom_dn));
+ ldb_dn_get_linearized(dom_dn));
talloc_free(res);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
@@ -273,7 +273,7 @@ static int samldb_get_new_sid(struct ldb_module *module,
/* allocate a new Rid for the domain */
ret = samldb_allocate_next_rid(module, mem_ctx, dom_dn, dom_sid, sid);
if (ret != 0) {
- ldb_debug(module->ldb, LDB_DEBUG_FATAL, "Failed to increment nextRid of %s: %s\n", ldb_dn_linearize(mem_ctx, dom_dn), ldb_errstring(module->ldb));
+ ldb_debug(module->ldb, LDB_DEBUG_FATAL, "Failed to increment nextRid of %s: %s\n", ldb_dn_get_linearized(dom_dn), ldb_errstring(module->ldb));
talloc_free(res);
return ret;
}