diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2015-12-02 16:44:36 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-07 05:33:52 +0300 |
commit | 98e9cb5711c68223f0e4d5201b9a6add255ec550 (patch) | |
tree | 12fee55d296fc85a6e8188368ca4944fc4d913a8 /fs/9p/xattr.c | |
parent | 97d79299223baab330b194437e676d301f12d5f6 (diff) | |
download | linux-98e9cb5711c68223f0e4d5201b9a6add255ec550.tar.xz |
vfs: Distinguish between full xattr names and proper prefixes
Add an additional "name" field to struct xattr_handler. When the name
is set, the handler matches attributes with exactly that name. When the
prefix is set instead, the handler matches attributes with the given
prefix and with a non-empty suffix.
This patch should avoid bugs like the one fixed in commit c361016a in
the future.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p/xattr.c')
-rw-r--r-- | fs/9p/xattr.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c index e3d026ac382e..9dd9b47a6c1a 100644 --- a/fs/9p/xattr.c +++ b/fs/9p/xattr.c @@ -143,8 +143,6 @@ static int v9fs_xattr_handler_get(const struct xattr_handler *handler, { const char *full_name = xattr_full_name(handler, name); - if (strcmp(name, "") == 0) - return -EINVAL; return v9fs_xattr_get(dentry, full_name, buffer, size); } @@ -154,8 +152,6 @@ static int v9fs_xattr_handler_set(const struct xattr_handler *handler, { const char *full_name = xattr_full_name(handler, name); - if (strcmp(name, "") == 0) - return -EINVAL; return v9fs_xattr_set(dentry, full_name, value, size, flags); } |