netatalk: acl_mappings.h Source File

netatalk 4.5.1
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
acl_mappings.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 ACL_MAPPINGS
16#define ACL_MAPPINGS
17
18#ifdef HAVE_SOLARIS_ACLS
19#include <sys/acl.h>
20#endif
21#ifdef HAVE_FREEBSD_SUNACL
22#include <sunacl.h>
23#endif
24
25#include "acls.h"
26
31
32/* Solaris 10u8 still hasn't got ACE_INHERITED_ACE */
33#ifndef ACE_INHERITED_ACE
34#define ACE_INHERITED_ACE 0x0080
35#endif
36
37 struct ace_rights_map {
38 uint32_t from;
39 uint32_t to;
40};
41
42#if (defined HAVE_SOLARIS_ACLS || defined HAVE_FREEBSD_SUNACL)
43struct ace_rights_map nfsv4_to_darwin_rights[] = {
44 {ACE_READ_DATA, DARWIN_ACE_READ_DATA},
45 {ACE_WRITE_DATA, DARWIN_ACE_WRITE_DATA},
46 {ACE_APPEND_DATA, DARWIN_ACE_APPEND_DATA},
47 {ACE_READ_NAMED_ATTRS, DARWIN_ACE_READ_EXTATTRIBUTES},
48 {ACE_WRITE_NAMED_ATTRS, DARWIN_ACE_WRITE_EXTATTRIBUTES},
49 {ACE_EXECUTE, DARWIN_ACE_EXECUTE},
50 {ACE_DELETE_CHILD, DARWIN_ACE_DELETE_CHILD},
51 {ACE_READ_ATTRIBUTES, DARWIN_ACE_READ_ATTRIBUTES},
52 {ACE_WRITE_ATTRIBUTES, DARWIN_ACE_WRITE_ATTRIBUTES},
53 {ACE_DELETE, DARWIN_ACE_DELETE},
54 {ACE_READ_ACL, DARWIN_ACE_READ_SECURITY},
55 {ACE_WRITE_ACL, DARWIN_ACE_WRITE_SECURITY},
56 {ACE_WRITE_OWNER, DARWIN_ACE_TAKE_OWNERSHIP},
57 {0, 0}
58};
59
60struct ace_rights_map darwin_to_nfsv4_rights[] = {
61 {DARWIN_ACE_READ_DATA, ACE_READ_DATA},
62 {DARWIN_ACE_WRITE_DATA, ACE_WRITE_DATA},
63 {DARWIN_ACE_APPEND_DATA, ACE_APPEND_DATA},
64 {DARWIN_ACE_READ_EXTATTRIBUTES, ACE_READ_NAMED_ATTRS},
65 {DARWIN_ACE_WRITE_EXTATTRIBUTES, ACE_WRITE_NAMED_ATTRS},
66 {DARWIN_ACE_EXECUTE, ACE_EXECUTE},
67 {DARWIN_ACE_DELETE_CHILD, ACE_DELETE_CHILD},
68 {DARWIN_ACE_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
69 {DARWIN_ACE_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
70 {DARWIN_ACE_DELETE, ACE_DELETE},
71 {DARWIN_ACE_READ_SECURITY, ACE_READ_ACL},
72 {DARWIN_ACE_WRITE_SECURITY, ACE_WRITE_ACL},
73 {DARWIN_ACE_TAKE_OWNERSHIP, ACE_WRITE_OWNER},
74 {0, 0}
75};
76
77struct nfsv4_to_darwin_flags_map {
78 uint16_t from;
79 uint32_t to;
80};
81
82struct nfsv4_to_darwin_flags_map nfsv4_to_darwin_flags[] = {
83 {ACE_FILE_INHERIT_ACE, DARWIN_ACE_FLAGS_FILE_INHERIT},
84 {ACE_DIRECTORY_INHERIT_ACE, DARWIN_ACE_FLAGS_DIRECTORY_INHERIT},
85 {ACE_NO_PROPAGATE_INHERIT_ACE, DARWIN_ACE_FLAGS_LIMIT_INHERIT},
86 {ACE_INHERIT_ONLY_ACE, DARWIN_ACE_FLAGS_ONLY_INHERIT},
87 {ACE_INHERITED_ACE, DARWIN_ACE_FLAGS_INHERITED},
88 {0, 0}
89};
90
91struct darwin_to_nfsv4_flags_map {
92 uint32_t from;
93 uint16_t to;
94};
95
96struct darwin_to_nfsv4_flags_map darwin_to_nfsv4_flags[] = {
97 {DARWIN_ACE_FLAGS_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
98 {DARWIN_ACE_FLAGS_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
99 {DARWIN_ACE_FLAGS_LIMIT_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
100 {DARWIN_ACE_FLAGS_ONLY_INHERIT, ACE_INHERIT_ONLY_ACE},
101 {DARWIN_ACE_FLAGS_INHERITED, ACE_INHERITED_ACE},
102 {0, 0}
103};
104#endif /* HAVE_SOLARIS_ACLS || HAVE_FREEBSD_SUNACL */
105
106#endif /* ACL_MAPPINGS */
ACE_INHERITED_ACE
#define ACE_INHERITED_ACE
Definition acl_mappings.h:34
acls.h
Definitions for ACL mapping code.
DARWIN_ACE_DELETE_CHILD
#define DARWIN_ACE_DELETE_CHILD
Definition acls.h:95
DARWIN_ACE_WRITE_EXTATTRIBUTES
#define DARWIN_ACE_WRITE_EXTATTRIBUTES
Definition acls.h:99
DARWIN_ACE_FLAGS_LIMIT_INHERIT
#define DARWIN_ACE_FLAGS_LIMIT_INHERIT
Definition acls.h:75
DARWIN_ACE_FLAGS_ONLY_INHERIT
#define DARWIN_ACE_FLAGS_ONLY_INHERIT
Definition acls.h:76
DARWIN_ACE_WRITE_SECURITY
#define DARWIN_ACE_WRITE_SECURITY
Definition acls.h:101
DARWIN_ACE_EXECUTE
#define DARWIN_ACE_EXECUTE
Definition acls.h:90
DARWIN_ACE_FLAGS_FILE_INHERIT
#define DARWIN_ACE_FLAGS_FILE_INHERIT
Definition acls.h:73
DARWIN_ACE_READ_ATTRIBUTES
#define DARWIN_ACE_READ_ATTRIBUTES
Definition acls.h:96
DARWIN_ACE_FLAGS_INHERITED
#define DARWIN_ACE_FLAGS_INHERITED
Definition acls.h:72
DARWIN_ACE_WRITE_DATA
#define DARWIN_ACE_WRITE_DATA
Definition acls.h:88
DARWIN_ACE_WRITE_ATTRIBUTES
#define DARWIN_ACE_WRITE_ATTRIBUTES
Definition acls.h:97
DARWIN_ACE_READ_EXTATTRIBUTES
#define DARWIN_ACE_READ_EXTATTRIBUTES
Definition acls.h:98
DARWIN_ACE_DELETE
#define DARWIN_ACE_DELETE
Definition acls.h:92
DARWIN_ACE_APPEND_DATA
#define DARWIN_ACE_APPEND_DATA
Definition acls.h:93
DARWIN_ACE_READ_DATA
#define DARWIN_ACE_READ_DATA
Definition acls.h:86
DARWIN_ACE_FLAGS_DIRECTORY_INHERIT
#define DARWIN_ACE_FLAGS_DIRECTORY_INHERIT
Definition acls.h:74
DARWIN_ACE_TAKE_OWNERSHIP
#define DARWIN_ACE_TAKE_OWNERSHIP
Definition acls.h:102
DARWIN_ACE_READ_SECURITY
#define DARWIN_ACE_READ_SECURITY
Definition acls.h:100
to
PATH_T to
Definition nad_cp.c:87
ace_rights_map
Definition acl_mappings.h:37
ace_rights_map::to
uint32_t to
Definition acl_mappings.h:39
ace_rights_map::from
uint32_t from
Definition acl_mappings.h:38