* [PATCH] cifs: Error STATUS_INVALID_OWNER should map to EACCES
@ 2015-12-08 11:59 Sachin Prabhu
[not found] ` <1449575977-9783-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Sachin Prabhu @ 2015-12-08 11:59 UTC (permalink / raw)
To: linux-cifs; +Cc: Shirish Pargaonkar
Error STATUS_INVALID_OWNER maps to -EIO. This was encountered when
a non priviledged user attempts to change ownership on a file to another
user on a share mounted with the cifsacl mount option.
# chown wintest1 a
chown: changing ownership of ‘a’: Input/output error
The error returned is confusing for users who do not expect this error.
The proposal is to return -EACCES instead when a STATUS_INVALID_OWNER is
returned.
Signed-off-by: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
fs/cifs/netmisc.c | 2 +-
fs/cifs/smb2maperror.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index abae6dd..301d3d4 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -324,7 +324,7 @@ static const struct {
ERRDOS, ERRunsup, NT_STATUS_CTL_FILE_NOT_SUPPORTED}, {
ERRHRD, ERRgeneral, NT_STATUS_UNKNOWN_REVISION}, {
ERRHRD, ERRgeneral, NT_STATUS_REVISION_MISMATCH}, {
- ERRHRD, ERRgeneral, NT_STATUS_INVALID_OWNER}, {
+ ERRDOS, ERRnoaccess, NT_STATUS_INVALID_OWNER}, {
ERRHRD, ERRgeneral, NT_STATUS_INVALID_PRIMARY_GROUP}, {
ERRHRD, ERRgeneral, NT_STATUS_NO_IMPERSONATION_TOKEN}, {
ERRHRD, ERRgeneral, NT_STATUS_CANT_DISABLE_MANDATORY}, {
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index 8257a5a..fd88cfa 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -384,7 +384,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
"STATUS_CTL_FILE_NOT_SUPPORTED"},
{STATUS_UNKNOWN_REVISION, -EIO, "STATUS_UNKNOWN_REVISION"},
{STATUS_REVISION_MISMATCH, -EIO, "STATUS_REVISION_MISMATCH"},
- {STATUS_INVALID_OWNER, -EIO, "STATUS_INVALID_OWNER"},
+ {STATUS_INVALID_OWNER, -EACCES, "STATUS_INVALID_OWNER"},
{STATUS_INVALID_PRIMARY_GROUP, -EIO, "STATUS_INVALID_PRIMARY_GROUP"},
{STATUS_NO_IMPERSONATION_TOKEN, -EIO, "STATUS_NO_IMPERSONATION_TOKEN"},
{STATUS_CANT_DISABLE_MANDATORY, -EIO, "STATUS_CANT_DISABLE_MANDATORY"},
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-09 6:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 11:59 [PATCH] cifs: Error STATUS_INVALID_OWNER should map to EACCES Sachin Prabhu
[not found] ` <1449575977-9783-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-12-09 6:10 ` Sachin Prabhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).