Package: fusedav
Version: 0.2-3
Severity: normal
Tags: upstream patch

The return value for unsupported flags arguments must be
negative for FUSE.

Additionally, failure to parse an attribute name now returns
ENOTSUP instead of ENOATTR.  According to the setxattr(2)
manpage, ENOATTR is only for the XATTR_REPLACE flag.

Returning ENOTSUP for invalid attributes now allows GNU cp(1)
to successfully archive files with a "cp -a" invocation.
>From ea2acf727beeed0030525d84271d0f7b6b0997b9 Mon Sep 17 00:00:00 2001
From: Eric Wong <[email protected]>
Date: Wed, 26 Dec 2012 19:24:46 +0000
Subject: [PATCH] setxattr: fix return values for errors

The return value for unsupported flags arguments must be
negative for FUSE.

Additionally, failure to parse an attribute name now returns
ENOTSUP instead of ENOATTR.  According to the setxattr(2)
manpage, ENOATTR is only for the XATTR_REPLACE flag.

Returning ENOTSUP for invalid attributes now allows GNU cp(1)
to successfully archive files with a "cp -a" invocation.
---
 src/fusedav.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fusedav.c b/src/fusedav.c
index be6d264..b0f2c46 100644
--- a/src/fusedav.c
+++ b/src/fusedav.c
@@ -1041,12 +1041,12 @@ static int dav_setxattr(
         fprintf(stderr, "setxattr(%s, %s)\n", path, name);
 
     if (flags) {
-        r = ENOTSUP;
+        r = -ENOTSUP;
         goto finish;
     }
     
     if (parse_xattr(name, dnspace, sizeof(dnspace), dname, sizeof(dname)) < 0) 
{
-        r = -ENOATTR;
+        r = -ENOTSUP;
         goto finish;
     }
 
-- 
1.8.0.3.gdd57fab.dirty

Reply via email to