= gensec_use_kerberos_mechs(conn, backends, conn->server_credentials);
int i, j = 0;
for (i = 0; ops && ops[i]; i++) {
- if (!gensec_security_ops_enabled(ops[i], conn->lp_ctx))
+ if (!lp_parm_bool(conn->lp_ctx, NULL, "gensec", ops[i]->name, ops[i]->enabled))
continue;
if (ops[i]->sasl_name && ops[i]->server_start) {
ent->attributes = talloc_array(ent_r, struct ldb_message_element, ent->num_attributes);
NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
for (j=0; j < ent->num_attributes; j++) {
- ent->attributes[j].name = talloc_steal(ent->attributes, res->msgs[i]->elements[j].name);
+ ent->attributes[j].name = res->msgs[i]->elements[j].name;
ent->attributes[j].num_values = 0;
ent->attributes[j].values = NULL;
if (req->attributesonly && (res->msgs[i]->elements[j].num_values == 0)) {
}
ent->attributes[j].num_values = res->msgs[i]->elements[j].num_values;
ent->attributes[j].values = res->msgs[i]->elements[j].values;
- talloc_steal(ent->attributes, res->msgs[i]->elements[j].values);
}
queue_reply:
ldapsrv_queue_reply(call, ent_r);
int result = LDAP_SUCCESS;
int ldb_ret;
- DEBUG(10, ("ModifyDNRequrest"));
+ DEBUG(10, ("ModifyDNRequest"));
DEBUGADD(10, (" dn: %s", req->dn));
DEBUGADD(10, (" newrdn: %s", req->newrdn));
DEBUG(10, ("ModifyDNRequest: olddn: [%s]\n", req->dn));
DEBUG(10, ("ModifyDNRequest: newrdn: [%s]\n", req->newrdn));
+ if (ldb_dn_get_comp_num(newrdn) != 1) {
+ result = LDAP_INVALID_DN_SYNTAX;
+ map_ldb_error(local_ctx, LDB_ERR_INVALID_DN_SYNTAX, &errstr);
+ goto reply;
+ }
+
/* we can't handle the rename if we should not remove the old dn */
if (!req->deleteolddn) {
result = LDAP_UNWILLING_TO_PERFORM;
NT_STATUS_HAVE_NO_MEMORY(parentdn);
}
- if ( ! ldb_dn_add_child_fmt(parentdn,
- "%s=%s",
- ldb_dn_get_rdn_name(newrdn),
- (char *)ldb_dn_get_rdn_val(newrdn)->data)) {
+ if ( ! ldb_dn_add_child(parentdn, newrdn)) {
result = LDAP_OTHER;
goto reply;
}