summaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-posix-acl.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-04-27 12:26:43 +0530
committerVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>2011-04-27 08:26:05 -0700
commita09947617cc3d0035f485d9804cd26c5a895b683 (patch)
treea31be067a5702088b4a3dbbcd6a3e9a24ec3fd06 /hw/9pfs/virtio-9p-posix-acl.c
parent39792515185350a21ec84b9eb65aafd0bb65525c (diff)
downloadqemu-a09947617cc3d0035f485d9804cd26c5a895b683.tar.gz
virtio-9p: removexattr on default acl should return 0
If we don't have default acl, removexattr on default acl should return 0 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/virtio-9p-posix-acl.c')
-rw-r--r--hw/9pfs/virtio-9p-posix-acl.c15
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 e4e0777107..575abe86b0 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;
}