Beruflich Dokumente
Kultur Dokumente
"types.h"
"layout.h"
"inode.h"
"dir.h"
"endians.h"
#ifndef POSIXACLS
#define POSIXACLS 0
#endif
/*
*
*/
struct MAPPING {
struct MAPPING *next;
int xid;
SID *sid;
int grcnt;
gid_t *groups;
};
/*
*
*
*/
/*
/*
/*
/*
struct CACHED_PERMISSIONS {
uid_t uid;
gid_t gid;
le32 inh_fileid;
le32 inh_dirid;
#if POSIXACLS
struct CACHED_PERMISSIONS_LEGACY {
struct CACHED_PERMISSIONS_LEGACY *next;
struct CACHED_PERMISSIONS_LEGACY *previous;
void *variable;
size_t varsize;
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
u64 mft_no;
struct CACHED_PERMISSIONS perm;
} ;
/*
*
*/
struct CACHED_SECURID {
struct CACHED_SECURID *next;
struct CACHED_SECURID *previous;
void *variable;
size_t varsize;
union ALIGNMENT payload[0];
/* above fields must match "struct CACHED_GENERIC" */
uid_t uid;
gid_t gid;
unsigned int dmode;
le32 securid;
} ;
/*
*
*
*/
struct CACHED_PERMISSIONS_HEADER {
unsigned int last;
/* statistics for permissions */
unsigned long p_writes;
unsigned long p_reads;
unsigned long p_hits;
} ;
/*
*
*/
struct PERMISSIONS_CACHE {
struct CACHED_PERMISSIONS_HEADER head;
struct CACHED_PERMISSIONS *cachetable[1]; /* array of variable size */
} ;
/*
*
*/
enum {
SECURITY_DEFAULT,
SECURITY_RAW,
SECURITY_ACL,
SECURITY_ADDSECURIDS,
SECURITY_STATICGRPS,
SECURITY_WANTED
/*
/*
/*
/*
/*
/*
} ;
/*
*
*/
struct POSIX_ACE {
u16 tag;
u16 perms;
s32 id;
} __attribute__((__packed__));
struct POSIX_ACL {
u8 version;
u8 flags;
u16 filler;
struct POSIX_ACE ace[0];
} __attribute__((__packed__));
struct POSIX_SECURITY {
mode_t mode;
int acccnt;
int defcnt;
int firstdef;
u16 tagsset;
s32 alignment[0];
struct POSIX_ACL acl;
} ;
/*
*
*/
enum {
POSIX_ACL_USER_OBJ =
POSIX_ACL_USER =
POSIX_ACL_GROUP_OBJ =
POSIX_ACL_GROUP =
POSIX_ACL_MASK =
POSIX_ACL_OTHER =
POSIX_ACL_SPECIAL =
1,
2,
4,
8,
16,
32,
64 /* internal use only */
} ;
#define POSIX_ACL_EXTENSIONS (POSIX_ACL_USER | POSIX_ACL_GROUP | POSIX_ACL_MASK)
/*
*
*/
enum {
POSIX_PERM_X =
POSIX_PERM_W =
POSIX_PERM_R =
POSIX_PERM_DENIAL =
1,
2,
4,
64 /* internal use only */
} ;
#define POSIX_VERSION 2
#endif
extern BOOL ntfs_guid_is_zero(const GUID *guid);
extern char *ntfs_guid_to_mbs(const GUID *guid, char *guid_str);
extern int ntfs_sid_to_mbs_size(const SID *sid);
extern char *ntfs_sid_to_mbs(const SID *sid, char *sid_str,
size_t sid_str_size);
extern void ntfs_generate_guid(GUID *guid);
extern int ntfs_sd_add_everyone(ntfs_inode *ni);
extern le32 ntfs_security_hash(const SECURITY_DESCRIPTOR_RELATIVE *sd,
const u32 len);
int ntfs_build_mapping(struct SECURITY_CONTEXT *scx, const char *usermap_path,
BOOL allowdef);
int ntfs_get_owner_mode(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, struct stat*);
int ntfs_set_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, mode_t mode);
BOOL ntfs_allowed_as_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni);
int ntfs_allowed_access(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, int accesstype);
int ntfs_allowed_create(struct SECURITY_CONTEXT *scx,
ntfs_inode *ni, gid_t *pgid, mode_t *pdsetgid);
BOOL old_ntfs_allowed_dir_access(struct SECURITY_CONTEXT *scx,
const char *path, int accesstype);
#if POSIXACLS
le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx,
uid_t uid, gid_t gid, ntfs_inode *dir_ni,
mode_t mode, BOOL isdir);
#else