smbd: Make open_file() a bit safer
commit6ec031b2d146962a414da69694d298c00df0c517
authorVolker Lendecke <vl@samba.org>
Tue, 5 Sep 2023 13:25:07 +0000 (5 15:25 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 5 Oct 2023 12:58:33 +0000 (5 12:58 +0000)
tree2973c0178511a6b6fda8b5035a69da1b19c1408e
parent884b9926b9ce5176e861bffd3ab62dec642ee786
smbd: Make open_file() a bit safer

Move adding O_RDWR before the check for read only shares. I haven't
been able to pass this condition through SMB, but in any case we
should not accidentially open with O_RDWR in the !CAN_WRITE(conn)
case.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c