diff options
author | Ralph Boehme <slow@samba.org> | 2022-08-14 18:51:30 +0200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-09-06 07:54:13 +0000 |
commit | d89294ecfc72b6e238e969fd7a3938a8df1cf058 (patch) | |
tree | 12af5562bd5eaa702f8f1cb5bd40fa061bfaeb7d /source4/torture | |
parent | 1d2444218383eccab86a89797c2d05b8e3b026a5 (diff) | |
download | samba-d89294ecfc72b6e238e969fd7a3938a8df1cf058.tar.gz |
s4/libcli/smb2: avoid using smb2_composite_setpathinfo() in smb2_util_setatr()
smb2_composite_setpathinfo() uses SEC_FLAG_MAXIMUM_ALLOWED which can
have unwanted side effects like breaking oplocks if the effective access
includes [READ|WRITE]_DATA.
For changing the DOS attributes we only need SEC_FILE_WRITE_ATTRIBUTE. With this
change test_smb2_oplock_batch25() doesn't trigger an oplock break anymore.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15153
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 66e40690bdd41800a01333ce4243bd62ee2b1894)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/oplock.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c index 6bf7567ddb1..8f275bafcdb 100644 --- a/source4/torture/smb2/oplock.c +++ b/source4/torture/smb2/oplock.c @@ -2957,15 +2957,9 @@ static bool test_smb2_oplock_batch25(struct torture_context *tctx, h1 = io.smb2.out.file.handle; CHECK_VAL(io.smb2.out.oplock_level, SMB2_OPLOCK_LEVEL_BATCH); - torture_comment(tctx, "changing the file attribute info should trigger " - "a break and a violation\n"); - status = smb2_util_setatr(tree1, fname, FILE_ATTRIBUTE_HIDDEN); - torture_assert_ntstatus_equal(tctx, status, NT_STATUS_SHARING_VIOLATION, - "Incorrect status"); - - torture_wait_for_oplock_break(tctx); - CHECK_VAL(break_info.count, 1); + torture_assert_ntstatus_ok(tctx, status, "Setting attributes " + "shouldn't trigger an oplock break"); smb2_util_close(tree1, h1); smb2_util_close(tree1, h); |