2004-11-05 10:29:02 +03:00
#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
*/
2004-11-18 06:31:35 +03:00
[
2005-02-13 02:03:26 +03:00
depends(security),
pointer_default(unique)
2004-11-18 06:31:35 +03:00
]
2004-11-05 10:29:02 +03:00
interface xattr
{
const string XATTR_DOSATTRIB_NAME = "user.DosAttrib";
const string XATTR_DOSATTRIB_ESTIMATED_SIZE = 64;
2004-11-05 14:31:35 +03:00
/* we store basic dos attributes in a DosAttrib xattr. By
using a union we can cope with new version of this
structure more easily */
2004-11-24 09:09:14 +03:00
2004-11-05 10:29:02 +03:00
typedef struct {
uint32 attrib;
uint32 ea_size;
2005-01-27 09:16:59 +03:00
udlong size;
udlong alloc_size;
2004-11-05 10:29:02 +03:00
NTTIME create_time;
NTTIME change_time;
} xattr_DosInfo1;
2004-11-24 09:09:14 +03:00
const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1;
typedef struct {
uint32 flags;
uint32 attrib;
uint32 ea_size;
2005-01-27 09:16:59 +03:00
udlong size;
udlong alloc_size;
2004-11-24 09:09:14 +03:00
NTTIME create_time;
NTTIME change_time;
NTTIME write_time; /* only used when sticky write time is set */
utf8string name; /* will be used for case-insensitive speedup */
} xattr_DosInfo2;
2005-03-06 20:02:14 +03:00
typedef [switch_type(uint16)] union {
2004-11-05 10:29:02 +03:00
[case(1)] xattr_DosInfo1 info1;
2004-11-24 09:09:14 +03:00
[case(2)] xattr_DosInfo2 info2;
2004-11-05 10:29:02 +03:00
} xattr_DosInfo;
typedef [public] struct {
uint16 version;
[switch_is(version)] xattr_DosInfo info;
} xattr_DosAttrib;
2004-11-05 14:31:35 +03:00
/* 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;
2005-03-05 21:34:18 +03:00
[size_is(num_eas)] xattr_EA *eas[];
2004-11-05 14:31:35 +03:00
} xattr_DosEAs;
2004-11-15 09:57:26 +03:00
/* 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;
2004-11-17 08:58:04 +03:00
/* stream data is stored in attributes with the given prefix */
const string XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
2004-11-17 15:36:14 +03:00
const int XATTR_MAX_STREAM_SIZE = 0x4000;
2004-11-15 09:57:26 +03:00
typedef struct {
uint32 flags;
2005-01-27 09:16:59 +03:00
udlong size;
udlong alloc_size;
2004-11-17 08:58:04 +03:00
utf8string name;
2004-11-15 09:57:26 +03:00
} xattr_DosStream;
typedef [public] struct {
uint32 num_streams;
2005-03-05 21:34:18 +03:00
[size_is(num_streams)] xattr_DosStream *streams[];
2004-11-15 09:57:26 +03:00
} xattr_DosStreams;
2004-11-18 06:31:35 +03:00
2004-11-24 09:09:14 +03:00
/* we store the NT ACL a NTACL xattr. It is versioned so we
2004-11-18 06:41:50 +03:00
can later add other acl attribs (such as posix acl mapping)
2004-11-18 06:31:35 +03:00
we put this xattr in the security namespace to ensure that
only trusted users can write to the ACL
*/
2004-11-18 08:35:48 +03:00
const string XATTR_NTACL_NAME = "security.NTACL";
2004-11-18 06:31:35 +03:00
2005-03-06 20:02:14 +03:00
typedef [switch_type(uint16)] union {
2004-11-18 06:31:35 +03:00
[case(1)] security_descriptor *sd;
2004-11-18 06:41:50 +03:00
} xattr_NTACL_Info;
2004-11-18 06:31:35 +03:00
typedef [public] struct {
uint16 version;
2004-11-18 06:41:50 +03:00
[switch_is(version)] xattr_NTACL_Info info;
} xattr_NTACL;
2004-11-18 06:31:35 +03:00
2004-11-05 10:29:02 +03:00
}