vfs: Distinguish between full xattr names and proper prefixes
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 2 Dec 2015 13:44:36 +0000 (14:44 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 7 Dec 2015 02:33:52 +0000 (21:33 -0500)
commit98e9cb5711c68223f0e4d5201b9a6add255ec550
tree12fee55d296fc85a6e8188368ca4944fc4d913a8
parent97d79299223baab330b194437e676d301f12d5f6
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>
22 files changed:
fs/9p/acl.c
fs/9p/xattr.c
fs/ext2/xattr_security.c
fs/ext2/xattr_trusted.c
fs/ext2/xattr_user.c
fs/ext4/xattr_security.c
fs/ext4/xattr_trusted.c
fs/ext4/xattr_user.c
fs/f2fs/xattr.c
fs/f2fs/xattr.h
fs/hfsplus/xattr.c
fs/jffs2/security.c
fs/jffs2/xattr_trusted.c
fs/jffs2/xattr_user.c
fs/nfs/nfs4proc.c
fs/ocfs2/xattr.c
fs/posix_acl.c
fs/reiserfs/xattr.c
fs/squashfs/xattr.c
fs/xattr.c
fs/xfs/xfs_xattr.c
include/linux/xattr.h