summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-11-27 19:10:50 +1100
committerAndrew Tridgell <tridge@samba.org>2009-11-27 19:42:11 +1100
commit9f3ac810a64a4ad1f60038b61659c59efe699559 (patch)
treea66f69ea7a860ac56644f1a4a31766b21b00fb9d /source4/torture
parentb3115f5cdc558ed71e11141e4f515511f3c6df5a (diff)
downloadsamba-9f3ac810a64a4ad1f60038b61659c59efe699559.tar.gz
samba-9f3ac810a64a4ad1f60038b61659c59efe699559.tar.bz2
samba-9f3ac810a64a4ad1f60038b61659c59efe699559.zip
s4-torture: fixed error code for s4 in SMB2-LOCK test
s4 returns NETWORK_NAME_DELETED if you attempt to use an invalid tree connection for a lock. This test (correctly I think) happens before we validate the file handle. That implies that when you pass both a closed handle and a invalid tree you should get NT_STATUS_NETWORK_NAME_DELETED.
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/smb2/lock.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index e3473ece2b..95b825e83e 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -1056,7 +1056,14 @@ static bool test_cancel_tdis(struct torture_context *torture,
lck.in.file.handle = h;
el[0].flags = SMB2_LOCK_FLAG_UNLOCK;
status = smb2_lock(tree, &lck);
- CHECK_STATUS(status, NT_STATUS_FILE_CLOSED);
+ if (torture_setting_bool(torture, "samba4", false)) {
+ /* checking if the tcon supplied are still valid
+ * should happen before you validate a file handle,
+ * so we should return USER_SESSION_DELETED */
+ CHECK_STATUS(status, NT_STATUS_NETWORK_NAME_DELETED);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_FILE_CLOSED);
+ }
done:
smb2_util_close(tree, h2);