xref: /onnv-gate/usr/src/common/acl/acl_common.h (revision 12164:0eb8d6741e37)
1789Sahrens /*
2789Sahrens  * CDDL HEADER START
3789Sahrens  *
4789Sahrens  * The contents of this file are subject to the terms of the
55331Samw  * Common Development and Distribution License (the "License").
65331Samw  * You may not use this file except in compliance with the License.
7789Sahrens  *
8789Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9789Sahrens  * or http://www.opensolaris.org/os/licensing.
10789Sahrens  * See the License for the specific language governing permissions
11789Sahrens  * and limitations under the License.
12789Sahrens  *
13789Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14789Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15789Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16789Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17789Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18789Sahrens  *
19789Sahrens  * CDDL HEADER END
20789Sahrens  */
21789Sahrens /*
22*12164SMark.Shellenbaum@Sun.COM  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23789Sahrens  */
24789Sahrens 
255331Samw #ifndef	_ACL_COMMON_H
265331Samw #define	_ACL_COMMON_H
27789Sahrens 
28789Sahrens #include <sys/types.h>
29789Sahrens #include <sys/acl.h>
30789Sahrens #include <sys/stat.h>
31789Sahrens 
325331Samw #ifdef	__cplusplus
33789Sahrens extern "C" {
34789Sahrens #endif
35789Sahrens 
36789Sahrens extern ace_t trivial_acl[6];
37789Sahrens 
38789Sahrens extern int acltrivial(const char *);
39789Sahrens extern void adjust_ace_pair(ace_t *pair, mode_t mode);
405331Samw extern void adjust_ace_pair_common(void *, size_t, size_t, mode_t);
41789Sahrens extern int ace_trivial(ace_t *acep, int aclcnt);
425331Samw extern int ace_trivial_common(void *, int,
435331Samw     uint64_t (*walk)(void *, uint64_t, int aclcnt, uint16_t *, uint16_t *,
445331Samw     uint32_t *mask));
455331Samw extern acl_t *acl_alloc(acl_type_t);
465331Samw extern void acl_free(acl_t *aclp);
475331Samw extern int acl_translate(acl_t *aclp, int target_flavor,
485331Samw     int isdir, uid_t owner, gid_t group);
49789Sahrens void ksort(caddr_t v, int n, int s, int (*f)());
50789Sahrens int cmp2acls(void *a, void *b);
51*12164SMark.Shellenbaum@Sun.COM int acl_trivial_create(mode_t mode, ace_t **acl, int *count);
52*12164SMark.Shellenbaum@Sun.COM void acl_trivial_access_masks(mode_t mode, uint32_t *allow0, uint32_t *deny1,
53*12164SMark.Shellenbaum@Sun.COM     uint32_t *deny2, uint32_t *owner, uint32_t *group, uint32_t *everyone);
54789Sahrens 
555331Samw #ifdef	__cplusplus
56789Sahrens }
57789Sahrens #endif
58789Sahrens 
595331Samw #endif /* _ACL_COMMON_H */
60