4 IDL structures for xattr file attributes
6 this has nothing to do with RPC, we are just using our NDR/IDL
7 infrastructure as a convenient way to store linearised information
8 about a file in a architecture independent manner
11 import
"security.idl";
14 uuid("12345778-1234-abcd-0001-00000002"),
16 helper
("../librpc/ndr/ndr_xattr.h"),
17 pointer_default(unique)
21 const char *XATTR_DOSATTRIB_NAME
= "user.DosAttrib";
22 const int XATTR_DOSATTRIB_ESTIMATED_SIZE
= 64;
24 /* we store basic dos attributes in a DosAttrib xattr. By
25 using a union we can cope with new version of this
26 structure more easily */
29 * the FFFF level is never really used,
30 * it's used to pass the information from
31 * the old hex string attrib information
32 * we have a handwritten parser which converts
33 * the hex string to the xattr_DosInfoFFFFCompat strucure
38 } xattr_DosInfoFFFFCompat
;
50 We use xattrDosInfo1 again when we store values.
51 Because the sticky write time is now stored in the opendb
52 and xattr_DosInfo2Old is only present to parse existing
55 const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
65 NTTIME write_time
; /* only used when sticky write time is set */
69 typedef [bitmap32bit
] bitmap
{
70 XATTR_DOSINFO_ATTRIB
= 0x00000001,
71 XATTR_DOSINFO_EA_SIZE
= 0x00000002,
72 XATTR_DOSINFO_SIZE
= 0x00000004,
73 XATTR_DOSINFO_ALLOC_SIZE
= 0x00000008,
74 XATTR_DOSINFO_CREATE_TIME
= 0x00000010,
75 XATTR_DOSINFO_CHANGE_TIME
= 0x00000020
76 } xattr_DosInfoValidFlags
;
79 xattr_DosInfoValidFlags valid_flags
;
88 typedef [public,switch_type(uint16
)] union {
89 [case(0xFFFF)] xattr_DosInfoFFFFCompat compatinfoFFFF
;
90 [case(1)] xattr_DosInfo1 info1
;
91 [case(2)] xattr_DosInfo2Old oldinfo2
;
92 [case(3)] xattr_DosInfo3 info3
;
95 typedef [public] struct {
97 [switch_is(version)] xattr_DosInfo info
;
100 typedef [public,nopush
,nopull
,noprint
] struct {
103 [switch_is(version)] xattr_DosInfo info
;
106 void xattr_parse_DOSATTRIB
(
107 [in] xattr_DOSATTRIB x
110 /* we store DOS style extended attributes in a DosEAs xattr */
111 const char *XATTR_DOSEAS_NAME
= "user.DosEAs";
118 typedef [public] struct {
120 [size_is(num_eas
)] xattr_EA
*eas
;
123 /* Slightly different version, used by the vfs_xattr_tdb module */
124 typedef [public] struct {
126 xattr_EA eas
[num_eas
];
129 /* we store stream information in this xattr structure. Then
130 the streams themselves are stored in
131 user.DosStream.STREAMNAME or in external files, according
133 const char *XATTR_DOSSTREAMS_NAME
= "user.DosStreams";
135 const int XATTR_STREAM_FLAG_INTERNAL
= 0x00000001;
137 /* stream data is stored in attributes with the given prefix */
138 const char *XATTR_DOSSTREAM_PREFIX
= "user.DosStream.";
140 const int XATTR_MAX_STREAM_SIZE
= 0x4000;
141 const int XATTR_MAX_STREAM_SIZE_TDB
= 0x100000;
150 typedef [public] struct {
152 [size_is(num_streams
)] xattr_DosStream
*streams
;
156 /* we store the NT ACL a NTACL xattr. It is versioned so we
157 can later add other acl attribs (such as posix acl mapping)
159 we put this xattr in the security namespace to ensure that
160 only trusted users can write to the ACL
162 stored in "security.NTACL"
164 Version 1. raw SD stored as Samba4 does it.
165 Version 2. raw SD + last changed hash so we
166 can discard if this doesn't match the underlying ACL hash.
169 const char *XATTR_NTACL_NAME
= "security.NTACL";
171 const int XATTR_SD_HASH_SIZE
= 64;
172 const int XATTR_SD_HASH_TYPE_NONE
= 0x0;
173 const int XATTR_SD_HASH_TYPE_SHA256
= 0x1;
175 typedef [public] struct {
176 security_descriptor
*sd
;
178 } security_descriptor_hash_v2
; /* Hash never used in this version. */
180 typedef [public] struct {
181 security_descriptor
*sd
;
183 uint8 hash
[64]; /* 64 bytes hash. */
184 } security_descriptor_hash_v3
;
186 typedef [switch_type(uint16
)] union {
187 [case(1)] security_descriptor
*sd
;
188 [case(2)] security_descriptor_hash_v2
*sd_hs2
;
189 [case(3)] security_descriptor_hash_v3
*sd_hs3
;
192 typedef [public] struct {
194 [switch_is(version)] xattr_NTACL_Info info
;