summaryrefslogtreecommitdiff
path: root/fuse.py
diff options
context:
space:
mode:
authorNick Coutsos <nick@coutsos.com>2013-06-26 01:30:48 -0300
committerNick Coutsos <nick@coutsos.com>2013-06-26 01:30:48 -0300
commit13f29e9f66e79eedefeaacf531ab002955514aee (patch)
treed7d1ab6fffdb533571fcc40d5038fd00581e851c /fuse.py
parent27d76e442d96139f9038d83d23275877fa3d3c9b (diff)
downloadfusepy-13f29e9f66e79eedefeaacf531ab002955514aee.tar.gz
Update the return value of FUSE.listxattr
By adding the extra '\x00' character to an otherwise empty string, fusepy makes it look like a file with no extra attributes has one (nameless?) attribute. xattr {file} prints one blank line, and xattr -l {file} prints "xattr: [Errno 22] Invalid argument: '{file}'"
Diffstat (limited to 'fuse.py')
-rw-r--r--fuse.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/fuse.py b/fuse.py
index 7a03d61..f546180 100644
--- a/fuse.py
+++ b/fuse.py
@@ -577,7 +577,9 @@ class FUSE(object):
def listxattr(self, path, namebuf, size):
attrs = self.operations('listxattr', path.decode(self.encoding)) or ''
- ret = '\x00'.join(attrs).encode(self.encoding) + '\x00'
+ ret = '\x00'.join(attrs).encode(self.encoding)
+ if len(ret) > 0:
+ ret += '\x00'
retsize = len(ret)
# allow size queries