1 #include <linux/reiserfs_fs.h>
2 #include <linux/capability.h>
3 #include <linux/errno.h>
5 #include <linux/pagemap.h>
6 #include <linux/xattr.h>
7 #include <linux/reiserfs_xattr.h>
8 #include <asm/uaccess.h>
11 trusted_get(struct inode
*inode
, const char *name
, void *buffer
, size_t size
)
13 if (strlen(name
) < sizeof(XATTR_TRUSTED_PREFIX
))
16 if (!reiserfs_xattrs(inode
->i_sb
))
19 if (!(capable(CAP_SYS_ADMIN
) || is_reiserfs_priv_object(inode
)))
22 return reiserfs_xattr_get(inode
, name
, buffer
, size
);
26 trusted_set(struct inode
*inode
, const char *name
, const void *buffer
,
27 size_t size
, int flags
)
29 if (strlen(name
) < sizeof(XATTR_TRUSTED_PREFIX
))
32 if (!reiserfs_xattrs(inode
->i_sb
))
35 if (!(capable(CAP_SYS_ADMIN
) || is_reiserfs_priv_object(inode
)))
38 return reiserfs_xattr_set(inode
, name
, buffer
, size
, flags
);
41 static int trusted_del(struct inode
*inode
, const char *name
)
43 if (strlen(name
) < sizeof(XATTR_TRUSTED_PREFIX
))
46 if (!reiserfs_xattrs(inode
->i_sb
))
49 if (!(capable(CAP_SYS_ADMIN
) || is_reiserfs_priv_object(inode
)))
56 trusted_list(struct inode
*inode
, const char *name
, int namelen
, char *out
)
60 if (!reiserfs_xattrs(inode
->i_sb
))
63 if (!(capable(CAP_SYS_ADMIN
) || is_reiserfs_priv_object(inode
)))
67 memcpy(out
, name
, len
);
72 struct reiserfs_xattr_handler trusted_handler
= {
73 .prefix
= XATTR_TRUSTED_PREFIX
,