Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v4.9 41 lines 1.1 kB view raw
1/* 2 * linux/fs/ext2/xattr_trusted.c 3 * Handler for trusted extended attributes. 4 * 5 * Copyright (C) 2003 by Andreas Gruenbacher, <a.gruenbacher@computer.org> 6 */ 7 8#include "ext2.h" 9#include "xattr.h" 10 11static bool 12ext2_xattr_trusted_list(struct dentry *dentry) 13{ 14 return capable(CAP_SYS_ADMIN); 15} 16 17static int 18ext2_xattr_trusted_get(const struct xattr_handler *handler, 19 struct dentry *unused, struct inode *inode, 20 const char *name, void *buffer, size_t size) 21{ 22 return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name, 23 buffer, size); 24} 25 26static int 27ext2_xattr_trusted_set(const struct xattr_handler *handler, 28 struct dentry *unused, struct inode *inode, 29 const char *name, const void *value, 30 size_t size, int flags) 31{ 32 return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name, 33 value, size, flags); 34} 35 36const struct xattr_handler ext2_xattr_trusted_handler = { 37 .prefix = XATTR_TRUSTED_PREFIX, 38 .list = ext2_xattr_trusted_list, 39 .get = ext2_xattr_trusted_get, 40 .set = ext2_xattr_trusted_set, 41};