summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-19 14:58:31 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-19 17:53:23 +0200
commit7cbe3035d9f0d534d017f65fa2250011c45bb415 (patch)
treed186f363c85c504556ca6ed3727c11f9e95e32c8 /source4
parente315aceda357711284da08094f80b1e03346fef0 (diff)
downloadsamba-7cbe3035d9f0d534d017f65fa2250011c45bb415.tar.gz
samba-7cbe3035d9f0d534d017f65fa2250011c45bb415.tar.bz2
samba-7cbe3035d9f0d534d017f65fa2250011c45bb415.zip
s4:ldap_backend.c - more customisations to match Windows Server error behaviour on renames
Diffstat (limited to 'source4')
-rw-r--r--source4/ldap_server/ldap_backend.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index 364fe54e0b..e1be4de0d7 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -940,9 +940,16 @@ static NTSTATUS ldapsrv_ModifyDNRequest(struct ldapsrv_call *call)
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, NULL,
+ if (ldb_dn_get_comp_num(newrdn) == 0) {
+ result = LDAP_PROTOCOL_ERROR;
+ map_ldb_error(local_ctx, LDB_ERR_PROTOCOL_ERROR, NULL,
+ &errstr);
+ goto reply;
+ }
+
+ if (ldb_dn_get_comp_num(newrdn) > 1) {
+ result = LDAP_NAMING_VIOLATION;
+ map_ldb_error(local_ctx, LDB_ERR_NAMING_VIOLATION, NULL,
&errstr);
goto reply;
}
@@ -961,24 +968,20 @@ static NTSTATUS ldapsrv_ModifyDNRequest(struct ldapsrv_call *call)
parentdn = ldb_dn_new(local_ctx, samdb, req->newsuperior);
VALID_DN_SYNTAX(parentdn);
DEBUG(10, ("ModifyDNRequest: newsuperior: [%s]\n", req->newsuperior));
-
- if (ldb_dn_get_comp_num(parentdn) < 1) {
- result = LDAP_AFFECTS_MULTIPLE_DSAS;
- map_ldb_error(local_ctx, LDB_ERR_AFFECTS_MULTIPLE_DSAS,
- NULL, &errstr);
- errstr = talloc_asprintf(local_ctx,
- "%s. Error new Superior DN invalid", errstr);
- goto reply;
- }
}
if (!parentdn) {
parentdn = ldb_dn_get_parent(local_ctx, olddn);
- NT_STATUS_HAVE_NO_MEMORY(parentdn);
+ }
+ if (!parentdn) {
+ result = LDAP_NO_SUCH_OBJECT;
+ map_ldb_error(local_ctx, LDB_ERR_NO_SUCH_OBJECT, NULL, &errstr);
+ goto reply;
}
if ( ! ldb_dn_add_child(parentdn, newrdn)) {
result = LDAP_OTHER;
+ map_ldb_error(local_ctx, LDB_ERR_OTHER, NULL, &errstr);
goto reply;
}
newdn = parentdn;