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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
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 <[hidden email]>
Reviewed-by: Gunther Deschner <[hidden email]>
Reported-by: Surabhi Bhalothia <[hidden email]>
---
 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


Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
On Thursday, 7 September 2017 13:49:49 CEST Sachin Prabhu via samba-technical
wrote:

> 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 <[hidden email]>
> Reviewed-by: Gunther Deschner <[hidden email]>
> Reported-by: Surabhi Bhalothia <[hidden email]>
> ---
>  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 },


RB+

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org