diff options
author | Rob Norris <[email protected]> | 2024-08-16 18:11:21 +1000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2024-09-18 11:23:50 -0700 |
commit | 79c307def906844178a9d0d031b53cd8f83b6164 (patch) | |
tree | 113e5641b10e646c09936d1e5ad4e8a1caf065d4 /module/os/linux | |
parent | 72d3fa215f28b88ea2d836efe4e5545486b7a2c8 (diff) |
config: remove HAVE_XATTR_HANDLER_NAME
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #16479
Diffstat (limited to 'module/os/linux')
-rw-r--r-- | module/os/linux/zfs/zpl_xattr.c | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index dc0113d38..bd313d36a 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -712,10 +712,6 @@ __zpl_xattr_user_get(struct inode *ip, const char *name, { int error; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") == 0) - return (-EINVAL); -#endif if (ZFS_XA_NS_PREFIX_FORBIDDEN(name)) return (-EINVAL); if (!(ITOZSB(ip)->z_flags & ZSB_XATTR)) @@ -745,10 +741,6 @@ __zpl_xattr_user_set(zidmap_t *user_ns, (void) user_ns; int error = 0; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") == 0) - return (-EINVAL); -#endif if (ZFS_XA_NS_PREFIX_FORBIDDEN(name)) return (-EINVAL); if (!(ITOZSB(ip)->z_flags & ZSB_XATTR)) @@ -835,10 +827,6 @@ __zpl_xattr_trusted_get(struct inode *ip, const char *name, if (!capable(CAP_SYS_ADMIN)) return (-EACCES); /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") == 0) - return (-EINVAL); -#endif xattr_name = kmem_asprintf("%s%s", XATTR_TRUSTED_PREFIX, name); error = zpl_xattr_get(ip, xattr_name, value, size); kmem_strfree(xattr_name); @@ -859,10 +847,6 @@ __zpl_xattr_trusted_set(zidmap_t *user_ns, if (!capable(CAP_SYS_ADMIN)) return (-EACCES); /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") == 0) - return (-EINVAL); -#endif xattr_name = kmem_asprintf("%s%s", XATTR_TRUSTED_PREFIX, name); error = zpl_xattr_set(ip, xattr_name, value, size, flags); kmem_strfree(xattr_name); @@ -905,10 +889,6 @@ __zpl_xattr_security_get(struct inode *ip, const char *name, char *xattr_name; int error; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") == 0) - return (-EINVAL); -#endif xattr_name = kmem_asprintf("%s%s", XATTR_SECURITY_PREFIX, name); error = zpl_xattr_get(ip, xattr_name, value, size); kmem_strfree(xattr_name); @@ -926,10 +906,6 @@ __zpl_xattr_security_set(zidmap_t *user_ns, char *xattr_name; int error; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") == 0) - return (-EINVAL); -#endif xattr_name = kmem_asprintf("%s%s", XATTR_SECURITY_PREFIX, name); error = zpl_xattr_set(ip, xattr_name, value, size, flags); kmem_strfree(xattr_name); @@ -1251,10 +1227,6 @@ __zpl_xattr_acl_get_access(struct inode *ip, const char *name, int type = ACL_TYPE_ACCESS; int error; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") != 0) - return (-EINVAL); -#endif if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX) return (-EOPNOTSUPP); @@ -1279,10 +1251,6 @@ __zpl_xattr_acl_get_default(struct inode *ip, const char *name, int type = ACL_TYPE_DEFAULT; int error; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") != 0) - return (-EINVAL); -#endif if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX) return (-EOPNOTSUPP); @@ -1308,10 +1276,6 @@ __zpl_xattr_acl_set_access(zidmap_t *mnt_ns, int type = ACL_TYPE_ACCESS; int error = 0; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") != 0) - return (-EINVAL); -#endif if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX) return (-EOPNOTSUPP); @@ -1354,10 +1318,6 @@ __zpl_xattr_acl_set_default(zidmap_t *mnt_ns, int type = ACL_TYPE_DEFAULT; int error = 0; /* xattr_resolve_name will do this for us if this is defined */ -#ifndef HAVE_XATTR_HANDLER_NAME - if (strcmp(name, "") != 0) - return (-EINVAL); -#endif if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX) return (-EOPNOTSUPP); @@ -1399,11 +1359,7 @@ ZPL_XATTR_SET_WRAPPER(zpl_xattr_acl_set_default); * whole name and reject anything that has .name only as prefix. */ static xattr_handler_t zpl_xattr_acl_access_handler = { -#ifdef HAVE_XATTR_HANDLER_NAME .name = XATTR_NAME_POSIX_ACL_ACCESS, -#else - .prefix = XATTR_NAME_POSIX_ACL_ACCESS, -#endif .list = zpl_xattr_acl_list_access, .get = zpl_xattr_acl_get_access, .set = zpl_xattr_acl_set_access, @@ -1416,15 +1372,11 @@ static xattr_handler_t zpl_xattr_acl_access_handler = { /* * ACL default xattr namespace handlers. * - * Use .name instead of .prefix when available. xattr_resolve_name will match - * whole name and reject anything that has .name only as prefix. + * Use .name instead of .prefix. xattr_resolve_name will match whole name and + * reject anything that has .name only as prefix. */ static xattr_handler_t zpl_xattr_acl_default_handler = { -#ifdef HAVE_XATTR_HANDLER_NAME .name = XATTR_NAME_POSIX_ACL_DEFAULT, -#else - .prefix = XATTR_NAME_POSIX_ACL_DEFAULT, -#endif .list = zpl_xattr_acl_list_default, .get = zpl_xattr_acl_get_default, .set = zpl_xattr_acl_set_default, |