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