#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
#include "auth/auth.h"
+#include "auth/credentials/credentials.h"
struct ildb_private {
struct ldap_connection *ldap;
search = &(msg->r.SearchResultEntry);
- ares->message->dn = ldb_dn_explode_or_special(ares->message, search->dn);
- if (ares->message->dn == NULL) {
+ ares->message->dn = ldb_dn_new(ares->message, ac->module->ldb, search->dn);
+ if ( ! ldb_dn_validate(ares->message->dn)) {
handle->status = LDB_ERR_OPERATIONS_ERROR;
return;
}
if (req->op.search.base == NULL) {
msg->r.SearchRequest.basedn = talloc_strdup(msg, "");
} else {
- msg->r.SearchRequest.basedn = ldb_dn_linearize(msg, req->op.search.base);
+ msg->r.SearchRequest.basedn = ldb_dn_alloc_linearized(msg, req->op.search.base);
}
if (msg->r.SearchRequest.basedn == NULL) {
ldb_set_errstring(module->ldb, "Unable to determine baseDN");
msg->type = LDAP_TAG_AddRequest;
- msg->r.AddRequest.dn = ldb_dn_linearize(msg, req->op.add.message->dn);
+ msg->r.AddRequest.dn = ldb_dn_alloc_linearized(msg, req->op.add.message->dn);
if (msg->r.AddRequest.dn == NULL) {
talloc_free(msg);
return LDB_ERR_INVALID_DN_SYNTAX;
msg->type = LDAP_TAG_ModifyRequest;
- msg->r.ModifyRequest.dn = ldb_dn_linearize(msg, req->op.mod.message->dn);
+ msg->r.ModifyRequest.dn = ldb_dn_alloc_linearized(msg, req->op.mod.message->dn);
if (msg->r.ModifyRequest.dn == NULL) {
talloc_free(msg);
return LDB_ERR_INVALID_DN_SYNTAX;
msg->type = LDAP_TAG_DelRequest;
- msg->r.DelRequest.dn = ldb_dn_linearize(msg, req->op.del.dn);
+ msg->r.DelRequest.dn = ldb_dn_alloc_linearized(msg, req->op.del.dn);
if (msg->r.DelRequest.dn == NULL) {
talloc_free(msg);
return LDB_ERR_INVALID_DN_SYNTAX;
}
msg->type = LDAP_TAG_ModifyDNRequest;
- msg->r.ModifyDNRequest.dn = ldb_dn_linearize(msg, req->op.rename.olddn);
+ msg->r.ModifyDNRequest.dn = ldb_dn_alloc_linearized(msg, req->op.rename.olddn);
if (msg->r.ModifyDNRequest.dn == NULL) {
talloc_free(msg);
return LDB_ERR_INVALID_DN_SYNTAX;
}
msg->r.ModifyDNRequest.newsuperior =
- ldb_dn_linearize(msg,
- ldb_dn_get_parent(msg, req->op.rename.newdn));
+ ldb_dn_alloc_linearized(msg, ldb_dn_get_parent(msg, req->op.rename.newdn));
if (msg->r.ModifyDNRequest.newsuperior == NULL) {
talloc_free(msg);
return LDB_ERR_INVALID_DN_SYNTAX;