From patchwork Wed Apr 27 06:56:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 92988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BFCF3B6EFF for ; Wed, 27 Apr 2011 16:56:49 +1000 (EST) Received: from localhost ([::1]:58859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEyg2-0004kB-Va for incoming@patchwork.ozlabs.org; Wed, 27 Apr 2011 02:56:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEyfu-0004k5-TT for qemu-devel@nongnu.org; Wed, 27 Apr 2011 02:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEyft-0003fP-Uh for qemu-devel@nongnu.org; Wed, 27 Apr 2011 02:56:38 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:57027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEyft-0003f9-7f for qemu-devel@nongnu.org; Wed, 27 Apr 2011 02:56:37 -0400 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp07.in.ibm.com (8.14.4/8.13.1) with ESMTP id p3R6uY1w009315 for ; Wed, 27 Apr 2011 12:26:34 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3R6uY2D3375190 for ; Wed, 27 Apr 2011 12:26:34 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3R6uY0s017344 for ; Wed, 27 Apr 2011 12:26:34 +0530 Received: from skywalker.in.ibm.com ([9.79.198.148]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p3R6uXVg017314; Wed, 27 Apr 2011 12:26:33 +0530 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Wed, 27 Apr 2011 12:26:32 +0530 Message-Id: <1303887392-7137-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 122.248.162.7 Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH] virtio-9p: removexattr on default acl should return 0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If we don't have default acl, removexattr on default acl should return 0 Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p-posix-acl.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/virtio-9p-posix-acl.c b/hw/9pfs/virtio-9p-posix-acl.c index e4e0777..575abe8 100644 --- a/hw/9pfs/virtio-9p-posix-acl.c +++ b/hw/9pfs/virtio-9p-posix-acl.c @@ -60,7 +60,7 @@ static int mp_pacl_removexattr(FsContext *ctx, ret = lremovexattr(rpath(ctx, path), MAP_ACL_ACCESS); if (ret == -1 && errno == ENODATA) { /* - * We don't get ENODATA error when trying to remote a + * We don't get ENODATA error when trying to remove a * posix acl that is not present. So don't throw the error * even in case of mapped security model */ @@ -103,7 +103,18 @@ static int mp_dacl_setxattr(FsContext *ctx, const char *path, const char *name, static int mp_dacl_removexattr(FsContext *ctx, const char *path, const char *name) { - return lremovexattr(rpath(ctx, path), MAP_ACL_DEFAULT); + int ret; + ret = lremovexattr(rpath(ctx, path), MAP_ACL_DEFAULT); + if (ret == -1 && errno == ENODATA) { + /* + * We don't get ENODATA error when trying to remove a + * posix acl that is not present. So don't throw the error + * even in case of mapped security model + */ + errno = 0; + ret = 0; + } + return ret; }