1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/capability.h>
4 #include <linux/errno.h>
6 #include <linux/pagemap.h>
7 #include <linux/xattr.h>
9 #include <linux/uaccess.h>
12 trusted_get(const struct xattr_handler
*handler
, struct dentry
*unused
,
13 struct inode
*inode
, const char *name
, void *buffer
, size_t size
)
15 if (!capable(CAP_SYS_ADMIN
) || IS_PRIVATE(inode
))
18 return reiserfs_xattr_get(inode
, xattr_full_name(handler
, name
),
23 trusted_set(const struct xattr_handler
*handler
, struct dentry
*unused
,
24 struct inode
*inode
, const char *name
, const void *buffer
,
25 size_t size
, int flags
)
27 if (!capable(CAP_SYS_ADMIN
) || IS_PRIVATE(inode
))
30 return reiserfs_xattr_set(inode
,
31 xattr_full_name(handler
, name
),
35 static bool trusted_list(struct dentry
*dentry
)
37 return capable(CAP_SYS_ADMIN
) && !IS_PRIVATE(d_inode(dentry
));
40 const struct xattr_handler reiserfs_xattr_trusted_handler
= {
41 .prefix
= XATTR_TRUSTED_PREFIX
,