• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3   File: linux/xattr.h
4 
5   Extended attributes handling.
6 
7   Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
8   Copyright (c) 2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
9   Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
10 */
11 
12 #include <linux/libc-compat.h>
13 
14 #ifndef _UAPI_LINUX_XATTR_H
15 #define _UAPI_LINUX_XATTR_H
16 
17 #if __UAPI_DEF_XATTR
18 #define __USE_KERNEL_XATTR_DEFS
19 
20 #define XATTR_CREATE	0x1	/* set value, fail if attr already exists */
21 #define XATTR_REPLACE	0x2	/* set value, fail if attr does not exist */
22 #endif
23 
24 /* Namespaces */
25 #define XATTR_OS2_PREFIX "os2."
26 #define XATTR_OS2_PREFIX_LEN (sizeof(XATTR_OS2_PREFIX) - 1)
27 
28 #define XATTR_MAC_OSX_PREFIX "osx."
29 #define XATTR_MAC_OSX_PREFIX_LEN (sizeof(XATTR_MAC_OSX_PREFIX) - 1)
30 
31 #define XATTR_BTRFS_PREFIX "btrfs."
32 #define XATTR_BTRFS_PREFIX_LEN (sizeof(XATTR_BTRFS_PREFIX) - 1)
33 
34 #define XATTR_SECURITY_PREFIX	"security."
35 #define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1)
36 
37 #define XATTR_SYSTEM_PREFIX "system."
38 #define XATTR_SYSTEM_PREFIX_LEN (sizeof(XATTR_SYSTEM_PREFIX) - 1)
39 
40 #define XATTR_TRUSTED_PREFIX "trusted."
41 #define XATTR_TRUSTED_PREFIX_LEN (sizeof(XATTR_TRUSTED_PREFIX) - 1)
42 
43 #define XATTR_USER_PREFIX "user."
44 #define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1)
45 
46 /* Security namespace */
47 #define XATTR_EVM_SUFFIX "evm"
48 #define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
49 
50 #define XATTR_IMA_SUFFIX "ima"
51 #define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
52 
53 #define XATTR_SELINUX_SUFFIX "selinux"
54 #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
55 
56 #define XATTR_SMACK_SUFFIX "SMACK64"
57 #define XATTR_SMACK_IPIN "SMACK64IPIN"
58 #define XATTR_SMACK_IPOUT "SMACK64IPOUT"
59 #define XATTR_SMACK_EXEC "SMACK64EXEC"
60 #define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
61 #define XATTR_SMACK_MMAP "SMACK64MMAP"
62 #define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
63 #define XATTR_NAME_SMACKIPIN	XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
64 #define XATTR_NAME_SMACKIPOUT	XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
65 #define XATTR_NAME_SMACKEXEC	XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
66 #define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
67 #define XATTR_NAME_SMACKMMAP XATTR_SECURITY_PREFIX XATTR_SMACK_MMAP
68 
69 #define XATTR_APPARMOR_SUFFIX "apparmor"
70 #define XATTR_NAME_APPARMOR XATTR_SECURITY_PREFIX XATTR_APPARMOR_SUFFIX
71 
72 #define XATTR_CAPS_SUFFIX "capability"
73 #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
74 
75 #define XATTR_POSIX_ACL_ACCESS  "posix_acl_access"
76 #define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
77 #define XATTR_POSIX_ACL_DEFAULT  "posix_acl_default"
78 #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
79 
80 
81 #endif /* _UAPI_LINUX_XATTR_H */
82