ldb_dn_compare: int (struct ldb_dn *, struct ldb_dn *)
ldb_dn_compare_base: int (struct ldb_dn *, struct ldb_dn *)
ldb_dn_copy: struct ldb_dn *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_copy_with_ldb_context: struct ldb_dn *(TALLOC_CTX *, struct ldb_dn *, struct ldb_context *)
ldb_dn_escape_value: char *(TALLOC_CTX *, struct ldb_val)
ldb_dn_extended_add_syntax: int (struct ldb_context *, unsigned int, const struct ldb_dn_extended_syntax *)
ldb_dn_extended_filter: void (struct ldb_dn *, const char * const *)
return new_dn;
}
+struct ldb_dn *ldb_dn_copy_with_ldb_context(TALLOC_CTX *mem_ctx,
+ struct ldb_dn *dn,
+ struct ldb_context *ldb)
+{
+ struct ldb_dn *new_dn = NULL;
+
+ new_dn = ldb_dn_copy(mem_ctx, dn);
+ if (new_dn == NULL) {
+ return NULL;
+ }
+
+ /* Set the ldb context. */
+ new_dn->ldb = ldb;
+ return new_dn;
+}
+
/* modify the given dn by adding a base.
*
* return true if successful and false if not
struct ldb_val value);
struct ldb_dn *ldb_dn_copy(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
+struct ldb_dn *ldb_dn_copy_with_ldb_context(TALLOC_CTX *mem_ctx,
+ struct ldb_dn *dn,
+ struct ldb_context *ldb);
struct ldb_dn *ldb_dn_get_parent(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
char *ldb_dn_canonical_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
char *ldb_dn_canonical_ex_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
* returned result, as it has already been
* casefolded
*/
- struct ldb_dn *dn = ldb_dn_copy(msg, ctx->base);
+ struct ldb_dn *dn = ldb_dn_copy_with_ldb_context(msg, ctx->base, ldb);
if (dn != NULL) {
msg->dn = dn;
}
modify_attr("lockoutThreshold", lockout_threshold)
creds = self.gmsa_account(kerberos_enabled=kerberos_enabled)
- dn = ldb.Dn(samdb, str(creds.get_dn()))
+ dn = creds.get_dn()
# Truncate the password to ensure that it is invalid.
creds.set_password(creds.get_password()[:-1])