r3832: added NT ACL query/set to the posix NTVFS backend. The default ACL is
[samba.git] / source4 / librpc / idl / xattr.idl
1 #include "idl_types.h"
2
3 /*
4    IDL structures for xattr file attributes
5
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
9 */
10
11 [
12   depends(security)
13 ]
14 interface xattr
15 {
16         const string XATTR_DOSATTRIB_NAME = "user.DosAttrib";
17         const string XATTR_DOSATTRIB_ESTIMATED_SIZE = 64;
18
19         /* we store basic dos attributes in a DosAttrib xattr. By
20            using a union we can cope with new version of this
21            structure more easily */
22         typedef struct {
23                 uint32 attrib;
24                 uint32 ea_size;
25                 uint64 size;
26                 uint64 alloc_size;
27                 NTTIME create_time;
28                 NTTIME change_time;
29         } xattr_DosInfo1;
30
31         typedef union {
32                 [case(1)] xattr_DosInfo1 info1;
33         } xattr_DosInfo;
34
35         typedef [public] struct {
36                 uint16 version;
37                 [switch_is(version)] xattr_DosInfo info;
38         } xattr_DosAttrib;
39
40
41         /* we store DOS style extended attributes in a DosEAs xattr */
42         const string XATTR_DOSEAS_NAME = "user.DosEAs";
43
44         typedef struct {
45                 utf8string name;
46                 DATA_BLOB value;
47         } xattr_EA;
48
49         typedef [public] struct {
50                 uint16 num_eas;
51                 [size_is(num_eas)] xattr_EA *eas;
52         } xattr_DosEAs;
53
54         /* we store stream information in this xattr structure. Then
55            the streams themselves are stored in
56            user.DosStream.STREAMNAME or in external files, according
57            to the flags */
58         const string XATTR_DOSSTREAMS_NAME = "user.DosStreams";
59
60         const int XATTR_STREAM_FLAG_INTERNAL = 0x00000001;
61
62         /* stream data is stored in attributes with the given prefix */
63         const string XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
64
65         const int XATTR_MAX_STREAM_SIZE = 0x4000;
66
67         typedef struct {
68                 uint32     flags;
69                 uint64     size;
70                 uint64     alloc_size;
71                 utf8string name;
72         } xattr_DosStream;
73
74         typedef [public] struct {
75                 uint32 num_streams;
76                 [size_is(num_streams)] xattr_DosStream *streams;
77         } xattr_DosStreams;
78
79
80         /* we store the NT ACL a DosAcl xattr. It is versioned so we
81            can later add other acl attribs (such as posix acl
82            mapping) 
83            
84            we put this xattr in the security namespace to ensure that
85            only trusted users can write to the ACL
86         */
87         const string XATTR_DOSACL_NAME = "security.DosAcl";
88
89         typedef union {
90                 [case(1)] security_descriptor *sd;
91         } xattr_DosAclInfo;
92
93         typedef [public] struct {
94                 uint16 version;
95                 [switch_is(version)] xattr_DosAclInfo info;
96         } xattr_DosAcl;
97
98 }