]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio-9p: removexattr on default acl should return 0
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 27 Apr 2011 06:56:43 +0000 (12:26 +0530)
committerVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Wed, 27 Apr 2011 15:26:05 +0000 (08:26 -0700)
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>
hw/9pfs/virtio-9p-posix-acl.c

index e4e077710734e3c1e9615f210825d7b3dea8b96c..575abe86b0951f638e05828200159154834f219f 100644 (file)
@@ -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;
 }