[PATCH] s3-lib: Fix error mapping for EROFS

Sachin Prabhu sprabhu at redhat.com
Thu Sep 7 11:49:49 UTC 2017


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 at redhat.com>
Reviewed-by: Gunther Deschner <gdeschne at redhat.com>
Reported-by: Surabhi Bhalothia <sbhaloth at redhat.com>
---
 source3/lib/errmap_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c
index f572b99d666..9eb30f7b814 100644
--- a/source3/lib/errmap_unix.c
+++ b/source3/lib/errmap_unix.c
@@ -71,7 +71,7 @@ static const struct {
 	{ EXDEV,        NT_STATUS_NOT_SAME_DEVICE },
 #endif
 #ifdef EROFS
-	{ EROFS,        NT_STATUS_ACCESS_DENIED },
+	{ EROFS,        NT_STATUS_MEDIA_WRITE_PROTECTED },
 #endif
 #ifdef ENAMETOOLONG
 	{ ENAMETOOLONG, NT_STATUS_OBJECT_NAME_INVALID },
-- 
2.13.5




More information about the samba-technical mailing list