7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 *
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 *
27 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
28 * Copyright 2017 RackTop Systems.
29 */
30
31 #ifndef _SYS_ACL_H
32 #define _SYS_ACL_H
33
34 #include <sys/types.h>
35 #include <sys/acl_impl.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #define MAX_ACL_ENTRIES (1024) /* max entries of each type */
42 typedef struct acl {
43 int a_type; /* the type of ACL entry */
44 uid_t a_id; /* the entry in -uid or gid */
45 o_mode_t a_perm; /* the permission field */
46 } aclent_t;
47
235 /*
236 * similar to ufs_acl.h: changed to char type for user commands (tar, cpio)
237 * Attribute types
238 */
239 #define UFSD_FREE ('0') /* Free entry */
240 #define UFSD_ACL ('1') /* Access Control Lists */
241 #define UFSD_DFACL ('2') /* reserved for future use */
242 #define ACE_ACL ('3') /* ace_t style acls */
243
244 /*
245 * flag to [f]acl_get()
246 * controls whether a trivial acl should be returned.
247 */
248 #define ACL_NO_TRIVIAL 0x2
249
250
251 /*
252 * Flags to control acl_totext()
253 */
254
255 #define ACL_APPEND_ID 0x1 /* append uid/gid to user/group entries */
256 #define ACL_COMPACT_FMT 0x2 /* build ACL in ls -V format */
257 #define ACL_NORESOLVE 0x4 /* don't do name service lookups */
258 #define ACL_SID_FMT 0x8 /* use usersid/groupsid when appropriate */
259
260 /*
261 * Legacy aclcheck errors for aclent_t ACLs
262 */
263 #define EACL_GRP_ERROR GRP_ERROR
264 #define EACL_USER_ERROR USER_ERROR
265 #define EACL_OTHER_ERROR OTHER_ERROR
266 #define EACL_CLASS_ERROR CLASS_ERROR
267 #define EACL_DUPLICATE_ERROR DUPLICATE_ERROR
268 #define EACL_MISS_ERROR MISS_ERROR
269 #define EACL_MEM_ERROR MEM_ERROR
270 #define EACL_ENTRY_ERROR ENTRY_ERROR
271
272 #define EACL_INHERIT_ERROR 9 /* invalid inherit flags */
273 #define EACL_FLAGS_ERROR 10 /* unknown flag value */
274 #define EACL_PERM_MASK_ERROR 11 /* unknown permission */
275 #define EACL_COUNT_ERROR 12 /* invalid acl count */
276
277 #define EACL_INVALID_SLOT 13 /* invalid acl slot */
278 #define EACL_NO_ACL_ENTRY 14 /* Entry doesn't exist */
|
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 *
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 *
27 * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
28 * Copyright 2017 RackTop Systems.
29 */
30
31 #ifndef _SYS_ACL_H
32 #define _SYS_ACL_H
33
34 #include <sys/types.h>
35 #include <sys/acl_impl.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #define MAX_ACL_ENTRIES (1024) /* max entries of each type */
42 typedef struct acl {
43 int a_type; /* the type of ACL entry */
44 uid_t a_id; /* the entry in -uid or gid */
45 o_mode_t a_perm; /* the permission field */
46 } aclent_t;
47
235 /*
236 * similar to ufs_acl.h: changed to char type for user commands (tar, cpio)
237 * Attribute types
238 */
239 #define UFSD_FREE ('0') /* Free entry */
240 #define UFSD_ACL ('1') /* Access Control Lists */
241 #define UFSD_DFACL ('2') /* reserved for future use */
242 #define ACE_ACL ('3') /* ace_t style acls */
243
244 /*
245 * flag to [f]acl_get()
246 * controls whether a trivial acl should be returned.
247 */
248 #define ACL_NO_TRIVIAL 0x2
249
250
251 /*
252 * Flags to control acl_totext()
253 */
254
255 #define ACL_APPEND_ID 0x01 /* append uid/gid to user/group entries */
256 #define ACL_COMPACT_FMT 0x02 /* build ACL in ls -V format */
257 #define ACL_NORESOLVE 0x04 /* don't do name service lookups */
258 #define ACL_SID_FMT 0x08 /* use usersid/groupsid when appropriate */
259 #define ACL_EPHEMERAL 0x10 /* Print raw ephemeral id */
260
261 /*
262 * Legacy aclcheck errors for aclent_t ACLs
263 */
264 #define EACL_GRP_ERROR GRP_ERROR
265 #define EACL_USER_ERROR USER_ERROR
266 #define EACL_OTHER_ERROR OTHER_ERROR
267 #define EACL_CLASS_ERROR CLASS_ERROR
268 #define EACL_DUPLICATE_ERROR DUPLICATE_ERROR
269 #define EACL_MISS_ERROR MISS_ERROR
270 #define EACL_MEM_ERROR MEM_ERROR
271 #define EACL_ENTRY_ERROR ENTRY_ERROR
272
273 #define EACL_INHERIT_ERROR 9 /* invalid inherit flags */
274 #define EACL_FLAGS_ERROR 10 /* unknown flag value */
275 #define EACL_PERM_MASK_ERROR 11 /* unknown permission */
276 #define EACL_COUNT_ERROR 12 /* invalid acl count */
277
278 #define EACL_INVALID_SLOT 13 /* invalid acl slot */
279 #define EACL_NO_ACL_ENTRY 14 /* Entry doesn't exist */
|