From patchwork Tue Dec 8 11:59:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Prabhu X-Patchwork-Id: 7796631 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E8D339F39B for ; Tue, 8 Dec 2015 11:59:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7F93204B5 for ; Tue, 8 Dec 2015 11:59:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BD35203DB for ; Tue, 8 Dec 2015 11:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755836AbbLHL7n (ORCPT ); Tue, 8 Dec 2015 06:59:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41949 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbbLHL7m (ORCPT ); Tue, 8 Dec 2015 06:59:42 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6EA63C00125D; Tue, 8 Dec 2015 11:59:42 +0000 (UTC) Received: from sprabhu-lp.pnq.redhat.com. (dhcp223-162.pnq.redhat.com [10.65.223.162]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB8BxcUC002032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 8 Dec 2015 06:59:41 -0500 From: Sachin Prabhu To: linux-cifs Cc: Shirish Pargaonkar Subject: [PATCH] cifs: Error STATUS_INVALID_OWNER should map to EACCES Date: Tue, 8 Dec 2015 17:29:37 +0530 Message-Id: <1449575977-9783-1-git-send-email-sprabhu@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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"},