summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-10-31 03:56:13 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:47 +0100
commit464dd2ada160002a888e3b2dd17cf0072fbcedf3 (patch)
treef7f0003baaf0bb238c590c3585b578797e9733aa /testprogs
parentdbb3c74464d84ff2b7bf1f98daa9db3db7d50734 (diff)
downloadsamba-464dd2ada160002a888e3b2dd17cf0072fbcedf3.tar.gz
samba-464dd2ada160002a888e3b2dd17cf0072fbcedf3.tar.bz2
samba-464dd2ada160002a888e3b2dd17cf0072fbcedf3.zip
r25761: Rename to be a DN to be a child of itself wasn't being checked for.
This prevents CN=test,dc=samba,dc=example,dc=com being renamed into CN=test2,cn=test,dc=samba,dc=example,dc=com Andrew Bartlett (This used to be commit 958a92ed0c6bee19d8b86df7c66330d2bba23e46)
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/ejs/ldap.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index c3003355b5..9be30c8eff 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -288,6 +288,13 @@ cn: LDAPtestUSER4
assert(res.msgs[0].dn == ("CN=ldaptestuser4,CN=ldaptestcontainer2," + base_dn));
+ println("Testing ldb.rename (into itself) of cn=ldaptestcontainer2," + base_dn + " to cn=ldaptestcontainer,cn=ldaptestcontainer2," + base_dn);
+ ok = ldb.rename("cn=ldaptestcontainer2," + base_dn, "cn=ldaptestcontainer,cn=ldaptestcontainer2," + base_dn);
+ if (ok.error != 53) { /* LDAP_UNWILLING_TO_PERFORM */
+ println(ok.errstr);
+ assert(ok.error == 53);
+ }
+
println("Testing delete (should fail, not a leaf node) of renamed cn=ldaptestcontainer2," + base_dn);
ok = ldb.del("cn=ldaptestcontainer2," + base_dn);
if (ok.error != 66) { /* LDB_ERR_NOT_ALLOWED_ON_NON_LEAF */