mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]>
Reviewed-by: James Morris <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
97d7929922
commit
98e9cb5711
22 changed files with 47 additions and 130 deletions
|
|
@ -52,9 +52,6 @@ static int jffs2_security_getxattr(const struct xattr_handler *handler,
|
|||
struct dentry *dentry, const char *name,
|
||||
void *buffer, size_t size)
|
||||
{
|
||||
if (!strcmp(name, ""))
|
||||
return -EINVAL;
|
||||
|
||||
return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY,
|
||||
name, buffer, size);
|
||||
}
|
||||
|
|
@ -63,9 +60,6 @@ static int jffs2_security_setxattr(const struct xattr_handler *handler,
|
|||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
{
|
||||
if (!strcmp(name, ""))
|
||||
return -EINVAL;
|
||||
|
||||
return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY,
|
||||
name, buffer, size, flags);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ static int jffs2_trusted_getxattr(const struct xattr_handler *handler,
|
|||
struct dentry *dentry, const char *name,
|
||||
void *buffer, size_t size)
|
||||
{
|
||||
if (!strcmp(name, ""))
|
||||
return -EINVAL;
|
||||
return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_TRUSTED,
|
||||
name, buffer, size);
|
||||
}
|
||||
|
|
@ -30,8 +28,6 @@ static int jffs2_trusted_setxattr(const struct xattr_handler *handler,
|
|||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
{
|
||||
if (!strcmp(name, ""))
|
||||
return -EINVAL;
|
||||
return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_TRUSTED,
|
||||
name, buffer, size, flags);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ static int jffs2_user_getxattr(const struct xattr_handler *handler,
|
|||
struct dentry *dentry, const char *name,
|
||||
void *buffer, size_t size)
|
||||
{
|
||||
if (!strcmp(name, ""))
|
||||
return -EINVAL;
|
||||
return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_USER,
|
||||
name, buffer, size);
|
||||
}
|
||||
|
|
@ -30,8 +28,6 @@ static int jffs2_user_setxattr(const struct xattr_handler *handler,
|
|||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
{
|
||||
if (!strcmp(name, ""))
|
||||
return -EINVAL;
|
||||
return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_USER,
|
||||
name, buffer, size, flags);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue