s4/libcli/smb2: avoid using smb2_composite_setpathinfo() in smb2_util_setatr()
commit41131daece9f84157aec4ac118b50483385485cc
authorRalph Boehme <slow@samba.org>
Sun, 14 Aug 2022 16:51:30 +0000 (14 18:51 +0200)
committerJule Anger <janger@samba.org>
Tue, 6 Sep 2022 06:32:13 +0000 (6 06:32 +0000)
tree3c4c94f19ec58f8f19bde28e280bc2d9baa14fdf
parentab0f75acbbc8fc3c4f307c8a2fb9bfaf558af364
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)
source4/libcli/smb2/util.c
source4/torture/smb2/oplock.c