2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _SYS_ACL_H
27 #define _SYS_ACL_H
28
29 #include <sys/types.h>
30 #include <sys/acl_impl.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #define MAX_ACL_ENTRIES (1024) /* max entries of each type */
37 typedef struct acl {
38 int a_type; /* the type of ACL entry */
39 uid_t a_id; /* the entry in -uid or gid */
40 o_mode_t a_perm; /* the permission field */
41 } aclent_t;
270 extern char *acltotext(aclent_t *, int);
271 extern aclent_t *aclfromtext(char *, int *);
272 extern void acl_free(acl_t *);
273 extern int acl_get(const char *, int, acl_t **);
274 extern int facl_get(int, int, acl_t **);
275 extern int acl_set(const char *, acl_t *acl);
276 extern int facl_set(int, acl_t *acl);
277 extern int acl_strip(const char *, uid_t, gid_t, mode_t);
278 extern int acl_trivial(const char *);
279 extern char *acl_totext(acl_t *, int);
280 extern int acl_fromtext(const char *, acl_t **);
281 extern int acl_check(acl_t *, int);
282
283 #else /* !defined(_KERNEL) */
284
285 extern void ksort(caddr_t, int, int, int (*)(void *, void *));
286 extern int cmp2acls(void *, void *);
287
288 #endif /* !defined(_KERNEL) */
289
290 #if defined(__STDC__)
291 extern int acl(const char *path, int cmd, int cnt, void *buf);
292 extern int facl(int fd, int cmd, int cnt, void *buf);
293 #else /* !__STDC__ */
294 extern int acl();
295 extern int facl();
296 #endif /* defined(__STDC__) */
297
298 #ifdef __cplusplus
299 }
300 #endif
301
302 #endif /* _SYS_ACL_H */
|
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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
28 #ifndef _SYS_ACL_H
29 #define _SYS_ACL_H
30
31 #include <sys/types.h>
32 #include <sys/acl_impl.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #define MAX_ACL_ENTRIES (1024) /* max entries of each type */
39 typedef struct acl {
40 int a_type; /* the type of ACL entry */
41 uid_t a_id; /* the entry in -uid or gid */
42 o_mode_t a_perm; /* the permission field */
43 } aclent_t;
272 extern char *acltotext(aclent_t *, int);
273 extern aclent_t *aclfromtext(char *, int *);
274 extern void acl_free(acl_t *);
275 extern int acl_get(const char *, int, acl_t **);
276 extern int facl_get(int, int, acl_t **);
277 extern int acl_set(const char *, acl_t *acl);
278 extern int facl_set(int, acl_t *acl);
279 extern int acl_strip(const char *, uid_t, gid_t, mode_t);
280 extern int acl_trivial(const char *);
281 extern char *acl_totext(acl_t *, int);
282 extern int acl_fromtext(const char *, acl_t **);
283 extern int acl_check(acl_t *, int);
284
285 #else /* !defined(_KERNEL) */
286
287 extern void ksort(caddr_t, int, int, int (*)(void *, void *));
288 extern int cmp2acls(void *, void *);
289
290 #endif /* !defined(_KERNEL) */
291
292 extern int acl(const char *path, int cmd, int cnt, void *buf);
293 extern int facl(int fd, int cmd, int cnt, void *buf);
294
295 #ifdef __cplusplus
296 }
297 #endif
298
299 #endif /* _SYS_ACL_H */
|