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 <[email protected]>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to