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 pointer_default(unique)
18 const char *XATTR_DOSATTRIB_NAME
= "user.DosAttrib";
19 const int XATTR_DOSATTRIB_ESTIMATED_SIZE
= 64;
21 /* we store basic dos attributes in a DosAttrib xattr. By
22 using a union we can cope with new version of this
23 structure more easily */
35 We use xattrDosInfo1 again when we store values.
36 Because the sticky write time is now stored in the opendb
37 and xattr_DosInfo2Old is only present to parse existing
40 const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
50 NTTIME write_time
; /* only used when sticky write time is set */
54 typedef [switch_type(uint16
)] union {
55 [case(1)] xattr_DosInfo1 info1
;
56 [case(2)] xattr_DosInfo2Old oldinfo2
;
59 typedef [public] struct {
61 [switch_is(version)] xattr_DosInfo info
;
65 /* we store DOS style extended attributes in a DosEAs xattr */
66 const char *XATTR_DOSEAS_NAME
= "user.DosEAs";
73 typedef [public] struct {
75 [size_is(num_eas
)] xattr_EA
*eas
;
78 /* Slightly different version, used by the vfs_xattr_tdb module */
79 typedef [public] struct {
81 xattr_EA eas
[num_eas
];
84 /* we store stream information in this xattr structure. Then
85 the streams themselves are stored in
86 user.DosStream.STREAMNAME or in external files, according
88 const char *XATTR_DOSSTREAMS_NAME
= "user.DosStreams";
90 const int XATTR_STREAM_FLAG_INTERNAL
= 0x00000001;
92 /* stream data is stored in attributes with the given prefix */
93 const char *XATTR_DOSSTREAM_PREFIX
= "user.DosStream.";
95 const int XATTR_MAX_STREAM_SIZE
= 0x4000;
96 const int XATTR_MAX_STREAM_SIZE_TDB
= 0x100000;
105 typedef [public] struct {
107 [size_is(num_streams
)] xattr_DosStream
*streams
;
111 /* we store the NT ACL a NTACL xattr. It is versioned so we
112 can later add other acl attribs (such as posix acl mapping)
114 we put this xattr in the security namespace to ensure that
115 only trusted users can write to the ACL
117 stored in "security.NTACL"
119 Version 1. raw SD stored as Samba4 does it.
120 Version 2. raw SD + last changed hash so we
121 can discard if this doesn't match the underlying ACL hash.
124 const char *XATTR_NTACL_NAME
= "security.NTACL";
126 const int XATTR_SD_HASH_SIZE
= 64;
127 const int XATTR_SD_HASH_TYPE_NONE
= 0x0;
128 const int XATTR_SD_HASH_TYPE_SHA256
= 0x1;
130 typedef [public] struct {
131 security_descriptor
*sd
;
133 } security_descriptor_hash_v2
; /* Hash never used in this version. */
135 typedef [public] struct {
136 security_descriptor
*sd
;
138 uint8 hash
[64]; /* 64 bytes hash. */
139 } security_descriptor_hash_v3
;
141 typedef [switch_type(uint16
)] union {
142 [case(1)] security_descriptor
*sd
;
143 [case(2)] security_descriptor_hash_v2
*sd_hs2
;
144 [case(3)] security_descriptor_hash_v3
*sd_hs3
;
147 typedef [public] struct {
149 [switch_is(version)] xattr_NTACL_Info info
;