Instead of replacing open flags with just O_RDONLY, filter out all those
flags unrelated to a Read Only File System
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14573
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Nov 12 17:23:19 UTC 2020 on sn-devel-184
(cherry picked from commit
e9e06a11daf036abf7a7022ebc8eaefde178aa52)
Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Thu Nov 19 14:09:43 UTC 2020 on sn-devel-184
* EINVAL which we carefully map to EROFS. In sum, this
* matches Windows behaviour.
*/
- flags = O_RDONLY;
+ flags &= ~(O_WRONLY | O_RDWR | O_CREAT);
}
return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
}
* pwrite() syscall with EINVAL which we carefully map to EROFS. In sum,
* this matches Windows behaviour.
*/
- flags = O_RDONLY;
+ flags &= ~(O_WRONLY | O_RDWR | O_CREAT);
ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
if (ret == -1) {