diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2015-12-02 08:44:36 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-06 21:33:52 -0500 |
commit | 98e9cb5711c68223f0e4d5201b9a6add255ec550 (patch) | |
tree | 12fee55d296fc85a6e8188368ca4944fc4d913a8 /fs/xfs | |
parent | 97d79299223baab330b194437e676d301f12d5f6 (diff) |
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/xfs')
-rw-r--r-- | fs/xfs/xfs_xattr.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 7288795718c9..36a43851aac0 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c | |||
@@ -39,9 +39,6 @@ xfs_xattr_get(const struct xattr_handler *handler, struct dentry *dentry, | |||
39 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); | 39 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); |
40 | int error, asize = size; | 40 | int error, asize = size; |
41 | 41 | ||
42 | if (strcmp(name, "") == 0) | ||
43 | return -EINVAL; | ||
44 | |||
45 | /* Convert Linux syscall to XFS internal ATTR flags */ | 42 | /* Convert Linux syscall to XFS internal ATTR flags */ |
46 | if (!size) { | 43 | if (!size) { |
47 | xflags |= ATTR_KERNOVAL; | 44 | xflags |= ATTR_KERNOVAL; |
@@ -84,9 +81,6 @@ xfs_xattr_set(const struct xattr_handler *handler, struct dentry *dentry, | |||
84 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); | 81 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); |
85 | int error; | 82 | int error; |
86 | 83 | ||
87 | if (strcmp(name, "") == 0) | ||
88 | return -EINVAL; | ||
89 | |||
90 | /* Convert Linux syscall to XFS internal ATTR flags */ | 84 | /* Convert Linux syscall to XFS internal ATTR flags */ |
91 | if (flags & XATTR_CREATE) | 85 | if (flags & XATTR_CREATE) |
92 | xflags |= ATTR_CREATE; | 86 | xflags |= ATTR_CREATE; |