smbd fails to correctly check sharemode against OVERWRITE dispositions

It goes like this:

  • create file and open read-only with FILE_SHARE_READ
  • second read-only open with OVERWRITE disposition and FILE_SHARE_READ

Against Windows the second open fails with STATUS_SHARING_VIOLATION. Against Samba the second open works.

This is simlar to bug 15439 where we fixed this problem for the SD filesystem check. Luckily this time there's no escalation of privileges and the fix is to also use open_access_mask, which includes WRITE_DATA access mapped from the OVERWRITE disposition, for the sharemode checks.

https://bugzilla.samba.org/show_bug.cgi?id=15732

Edited by Ralph Böhme

Merge request reports

Loading