s3-lib: Fix error mapping for EROFS
authorSachin Prabhu via samba-technical <samba-technical@lists.samba.org>
Thu, 7 Sep 2017 11:49:49 +0000 (12:49 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 8 Sep 2017 00:33:14 +0000 (02:33 +0200)
commit47b4fcab1636e51ab9477f9e89153500c774c74f
tree50497c952690bc7c1f4a34e5f9ce03de5176aa00
parentc938f61d332de0323cb135b201367f90f08d76a8
s3-lib: Fix error mapping for EROFS

EROFS is incorrectly mapped to NT_STATUS_ACCESS_DENIED. This should
instead be mapped to NT_STATUS_MEDIA_WRITE_PROTECTED.

This change has already been done for the client in
unix_nt_errmap in libcli/util/errmap_unix.c
commit 9d055846f225 ("r3278: - rewrote the client side rpc...)")

SMB1 specs for SMB_COM_DELETE also specifies this mapping for EROFS
https://msdn.microsoft.com/en-us/library/ee441772.aspx

RH bz: 1171705
This problem was reported by Red Hat glusterfs QE who encountered
different errors when performing the same operation on a fuse mount and
on a cifs mount of the same underlying gluster filesystem.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Gunther Deschner <gdeschne@redhat.com>
Reported-by: Surabhi Bhalothia <sbhaloth@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/errmap_unix.c