summaryrefslogtreecommitdiffstats
path: root/fs/ext2/xattr_security.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2015-12-02 14:44:36 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-07 03:33:52 +0100
commit98e9cb5711c68223f0e4d5201b9a6add255ec550 (patch)
tree12fee55d296fc85a6e8188368ca4944fc4d913a8 /fs/ext2/xattr_security.c
parentposix acls: Remove duplicate xattr name definitions (diff)
downloadlinux-98e9cb5711c68223f0e4d5201b9a6add255ec550.tar.xz
linux-98e9cb5711c68223f0e4d5201b9a6add255ec550.zip
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/ext2/xattr_security.c')
-rw-r--r--fs/ext2/xattr_security.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c
index dfb08750370d..118bf231bc7f 100644
--- a/fs/ext2/xattr_security.c
+++ b/fs/ext2/xattr_security.c
@@ -28,8 +28,6 @@ ext2_xattr_security_get(const struct xattr_handler *handler,
struct dentry *dentry, const char *name,
void *buffer, size_t size)
{
- if (strcmp(name, "") == 0)
- return -EINVAL;
return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_SECURITY, name,
buffer, size);
}
@@ -39,8 +37,6 @@ ext2_xattr_security_set(const struct xattr_handler *handler,
struct dentry *dentry, const char *name,
const void *value, size_t size, int flags)
{
- if (strcmp(name, "") == 0)
- return -EINVAL;
return ext2_xattr_set(d_inode(dentry), EXT2_XATTR_INDEX_SECURITY, name,
value, size, flags);
}