netatalk
4.4.3
Free and Open Source Apple Filing Protocol (AFP) Server
Toggle main menu visibility
Loading...
Searching...
No Matches
acls.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2008,2009 Frank Lahm <franklahm@gmail.com>
3
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
*/
14
15
#ifndef AFPD_ACLS_H
16
#define AFPD_ACLS_H
17
18
#ifdef HAVE_FREEBSD_SUNACL
19
#include <sunacl.h>
20
#endif
21
22
#ifdef HAVE_SOLARIS_ACLS
23
#include <sys/acl.h>
24
#endif
25
26
/* for atalk_uuid_t */
27
#include <
atalk/uuid.h
>
28
29
#include "
directory.h
"
30
46
47
#ifdef HAVE_NFSV4_ACLS
49
#define ACE_TRIVIAL (ACE_OWNER | ACE_GROUP | ACE_EVERYONE)
50
#endif
/* HAVE_NFSV4_ACLS */
51
53
enum
{
54
kFileSec_UUID
= (1 << 0),
55
kFileSec_GRPUUID
= (1 << 1),
56
kFileSec_ACL
= (1 << 2),
57
kFileSec_REMOVEACL
= (1 << 3),
58
kFileSec_Inherit
= (1 << 4)
59
};
60
62
#define DARWIN_ACL_FLAGS_PRIVATE (0xffff)
64
#define KAUTH_ACL_DEFER_INHERIT (1<<16)
66
#define KAUTH_ACL_NO_INHERIT (1<<17)
67
68
/* ACE Flags */
69
#define DARWIN_ACE_FLAGS_KINDMASK 0xf
70
#define DARWIN_ACE_FLAGS_PERMIT (1<<0)
71
#define DARWIN_ACE_FLAGS_DENY (1<<1)
72
#define DARWIN_ACE_FLAGS_INHERITED (1<<4)
73
#define DARWIN_ACE_FLAGS_FILE_INHERIT (1<<5)
74
#define DARWIN_ACE_FLAGS_DIRECTORY_INHERIT (1<<6)
75
#define DARWIN_ACE_FLAGS_LIMIT_INHERIT (1<<7)
76
#define DARWIN_ACE_FLAGS_ONLY_INHERIT (1<<8)
77
79
#define DARWIN_ACE_INHERIT_CONTROL_FLAGS \
80
(DARWIN_ACE_FLAGS_FILE_INHERIT |\
81
DARWIN_ACE_FLAGS_DIRECTORY_INHERIT |\
82
DARWIN_ACE_FLAGS_LIMIT_INHERIT |\
83
DARWIN_ACE_FLAGS_ONLY_INHERIT)
84
85
/* ACE Rights */
86
#define DARWIN_ACE_READ_DATA 0x00000002
87
#define DARWIN_ACE_LIST_DIRECTORY 0x00000002
88
#define DARWIN_ACE_WRITE_DATA 0x00000004
89
#define DARWIN_ACE_ADD_FILE 0x00000004
90
#define DARWIN_ACE_EXECUTE 0x00000008
91
#define DARWIN_ACE_SEARCH 0x00000008
92
#define DARWIN_ACE_DELETE 0x00000010
93
#define DARWIN_ACE_APPEND_DATA 0x00000020
94
#define DARWIN_ACE_ADD_SUBDIRECTORY 0x00000020
95
#define DARWIN_ACE_DELETE_CHILD 0x00000040
96
#define DARWIN_ACE_READ_ATTRIBUTES 0x00000080
97
#define DARWIN_ACE_WRITE_ATTRIBUTES 0x00000100
98
#define DARWIN_ACE_READ_EXTATTRIBUTES 0x00000200
99
#define DARWIN_ACE_WRITE_EXTATTRIBUTES 0x00000400
100
#define DARWIN_ACE_READ_SECURITY 0x00000800
101
#define DARWIN_ACE_WRITE_SECURITY 0x00001000
102
#define DARWIN_ACE_TAKE_OWNERSHIP 0x00002000
103
105
typedef
struct
{
106
atalk_uuid_t
darwin_ace_uuid
;
107
uint32_t
darwin_ace_flags
;
108
uint32_t
darwin_ace_rights
;
109
}
darwin_ace_t
;
110
112
typedef
struct
{
113
uint32_t
darwin_acl_count
;
114
uint32_t
darwin_acl_flags
;
115
}
darwin_acl_header_t
;
116
117
/* FP functions */
118
int
afp_access
(
AFPObj
*
obj
,
char
*ibuf,
size_t
ibuflen,
char
*
rbuf
,
119
size_t
*
rbuflen
);
120
int
afp_getacl
(
AFPObj
*
obj
,
char
*ibuf,
size_t
ibuflen,
char
*
rbuf
,
121
size_t
*
rbuflen
);
122
int
afp_setacl
(
AFPObj
*
obj
,
char
*ibuf,
size_t
ibuflen,
char
*
rbuf
,
123
size_t
*
rbuflen
);
124
125
/* Misc funcs */
126
extern
int
acltoownermode
(
const
AFPObj
*
obj
,
const
struct
vol
*
vol
,
char
*
path
,
127
struct
stat *st,
struct
maccess
*ma);
128
#endif
afp_getacl
int afp_getacl(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition
acls.c:1804
afp_setacl
int afp_setacl(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition
acls.c:1922
acltoownermode
int acltoownermode(const AFPObj *obj, const struct vol *vol, char *path, struct stat *st, struct maccess *ma)
map ACL to user maccess
Definition
acls.c:2082
afp_access
int afp_access(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition
acls.c:1747
kFileSec_GRPUUID
#define kFileSec_GRPUUID
Definition
afpclient.h:384
kFileSec_Inherit
#define kFileSec_Inherit
Definition
afpclient.h:387
kFileSec_ACL
#define kFileSec_ACL
Definition
afpclient.h:385
kFileSec_REMOVEACL
#define kFileSec_REMOVEACL
Definition
afpclient.h:386
kFileSec_UUID
#define kFileSec_UUID
Definition
afpclient.h:383
rbuflen
static size_t rbuflen
Definition
afpfunc_helpers.c:45
rbuf
static char rbuf[rbufsize]
Definition
afpfunc_helpers.c:44
directory.h
obj
static AFPObj obj
Definition
netatalk.c:62
AFPObj
Definition
globals.h:158
darwin_ace_t
Definition
acls.h:105
darwin_ace_t::darwin_ace_uuid
atalk_uuid_t darwin_ace_uuid
Definition
acls.h:106
darwin_ace_t::darwin_ace_flags
uint32_t darwin_ace_flags
Definition
acls.h:107
darwin_ace_t::darwin_ace_rights
uint32_t darwin_ace_rights
Definition
acls.h:108
darwin_acl_header_t
Definition
acls.h:112
darwin_acl_header_t::darwin_acl_flags
uint32_t darwin_acl_flags
Definition
acls.h:114
darwin_acl_header_t::darwin_acl_count
uint32_t darwin_acl_count
Definition
acls.h:113
maccess
Definition
etc/afpd/directory.h:68
path
Definition
include/atalk/directory.h:82
vol
Definition
include/atalk/volume.h:30
uuid.h
atalk_uuid_t
unsigned char atalk_uuid_t[UUID_BINSIZE]
Definition
uuid.h:21
etc
afpd
acls.h
Generated by
1.17.0