Bug 59811 - CIFS getxattr() returns success for non existing extended attributes
Summary: CIFS getxattr() returns success for non existing extended attributes
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: CIFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_cifs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-17 09:30 UTC by Jean-Francois Dockes
Modified: 2019-02-07 09:57 UTC (History)
5 users (show)

See Also:
Kernel Version: 3.2.0-48-generic
Tree: Mainline
Regression: No


Attachments

Description Jean-Francois Dockes 2013-06-17 09:30:46 UTC
getxattr should return -1 for non-existing attributes, but it returns 0 (meaning existing attribute with empty value) instead.

How to reproduce: just use getfattr:

/mnt is cifs mount, /tmp/local is a local file system
hautmedoc$ mount
[...]
//y/tmp on /mnt type cifs (rw)
[...]


hautmedoc$ cd /mnt
hautmedoc$ getfattr -n user.nosuchattr orange3.pdf 
# file: orange3.pdf
user.nosuchattr

hautmedoc$ cd /tmp
hautmedoc$ getfattr -n user.nosuchattr orange3.pdf 
orange3.pdf: user.nosuchattr: No such attribute
Comment 1 Jeff Layton 2013-06-17 10:45:21 UTC
cc'ing Steve since he has been doing some xattr work recently. Steve maybe you can fix this while you're in there too?
Comment 2 Ronnie Sahlberg 2019-02-07 03:56:26 UTC
This bug has been fixed a while ago.

$ getfattr -n user.nosuchattr /mnt/foo
/mnt/foo: user.nosuchattr: No such attribute

Note You need to log in before you can comment on or make changes to this bug.