From 4732f5b2108f6c16849f8c7a7fae3cc486cf0fe3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 28 Sep 2011 08:47:56 +0200 Subject: s4:torture/smb2/lock: remove samba4 specific checks for NETWORK_NAME_DELETED/USER_SESSION_DELETED Most Windows versions have a strange order to verify the session id, tree id and file id. (They should be checked in that order, but windows seems to check the file id before the others). metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Wed Sep 28 21:12:07 CEST 2011 on sn-devel-104 --- source4/torture/smb2/lock.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'source4/torture/smb2/lock.c') diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c index 5bccf04f43..aee82929c1 100644 --- a/source4/torture/smb2/lock.c +++ b/source4/torture/smb2/lock.c @@ -1056,12 +1056,13 @@ 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); - 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 { + /* + * Most Windows versions have a strange order to + * verify the session id, tree id and file id. + * (They should be checked in that order, but windows + * seems to check the file id before the others). + */ + if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) { CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); } @@ -1141,12 +1142,13 @@ static bool test_cancel_logoff(struct torture_context *torture, lck.in.file.handle = h; el[0].flags = SMB2_LOCK_FLAG_UNLOCK; status = smb2_lock(tree, &lck); - if (torture_setting_bool(torture, "samba4", false)) { - /* checking if the credential supplied are still valid - * should happen before you validate a file handle, - * so we should return USER_SESSION_DELETED */ - CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED); - } else { + /* + * Most Windows versions have a strange order to + * verify the session id, tree id and file id. + * (They should be checked in that order, but windows + * seems to check the file id before the others). + */ + if (!NT_STATUS_EQUAL(status, NT_STATUS_USER_SESSION_DELETED)) { CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); } -- cgit