s3:rpc_client: close the socket when pipe is broken
[Samba.git] / librpc / idl / xattr.idl
blob4191ea67ceb7ff0fc9fe08752996dcbb8aa5c8bb
1 #include "idl_types.h"
3 /*
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
9 */
11 import "security.idl";
14 pointer_default(unique)
16 interface xattr
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 */
25 typedef struct {
26 uint32 attrib;
27 uint32 ea_size;
28 udlong size;
29 udlong alloc_size;
30 NTTIME create_time;
31 NTTIME change_time;
32 } xattr_DosInfo1;
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
38 values from disk.
40 const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
42 typedef struct {
43 uint32 flags;
44 uint32 attrib;
45 uint32 ea_size;
46 udlong size;
47 udlong alloc_size;
48 NTTIME create_time;
49 NTTIME change_time;
50 NTTIME write_time; /* only used when sticky write time is set */
51 utf8string name;
52 } xattr_DosInfo2Old;
54 typedef [switch_type(uint16)] union {
55 [case(1)] xattr_DosInfo1 info1;
56 [case(2)] xattr_DosInfo2Old oldinfo2;
57 } xattr_DosInfo;
59 typedef [public] struct {
60 uint16 version;
61 [switch_is(version)] xattr_DosInfo info;
62 } xattr_DosAttrib;
65 /* we store DOS style extended attributes in a DosEAs xattr */
66 const char *XATTR_DOSEAS_NAME = "user.DosEAs";
68 typedef struct {
69 utf8string name;
70 DATA_BLOB value;
71 } xattr_EA;
73 typedef [public] struct {
74 uint16 num_eas;
75 [size_is(num_eas)] xattr_EA *eas;
76 } xattr_DosEAs;
78 /* Slightly different version, used by the vfs_xattr_tdb module */
79 typedef [public] struct {
80 uint32 num_eas;
81 xattr_EA eas[num_eas];
82 } tdb_xattrs;
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
87 to the flags */
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;
98 typedef struct {
99 uint32 flags;
100 udlong size;
101 udlong alloc_size;
102 utf8string name;
103 } xattr_DosStream;
105 typedef [public] struct {
106 uint32 num_streams;
107 [size_is(num_streams)] xattr_DosStream *streams;
108 } xattr_DosStreams;
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 typedef [public] struct {
127 security_descriptor *sd;
128 uint8 hash[16];
129 } security_descriptor_hash;
131 typedef [switch_type(uint16)] union {
132 [case(1)] security_descriptor *sd;
133 [case(2)] security_descriptor_hash *sd_hs;
134 } xattr_NTACL_Info;
136 typedef [public] struct {
137 uint16 version;
138 [switch_is(version)] xattr_NTACL_Info info;
139 } xattr_NTACL;