acl.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_ACL_H
#define _SYS_ACL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct acl {
int a_type; /* the type of ACL entry */
} aclent_t;
typedef struct ace {
} ace_t;
/*
* The following are Defined types for an aclent_t.
*/
/* default object owner */
/* defalut additional users */
/* default owning group */
/* default additional groups */
/* default mask entry */
/* default other entry */
/*
* The following are defined for ace_t.
*/
#define ACE_FILE_INHERIT_ACE 0x0001
#define ACE_DIRECTORY_INHERIT_ACE 0x0002
#define ACE_NO_PROPOGATE_INHERIT_ACE 0x0004
#define ACE_INHERIT_ONLY_ACE 0x0008
#define ACE_LOCALLY_DEFINED 0x0010
/*
* The following flags are supported by both NFSv4 ACLs and ace_t.
*/
#define ACE_NFSV4_SUP_FLAGS (ACE_FILE_INHERIT_ACE | \
#define ALLOW 0
#define DENY 1
/* cmd args to acl(2) for aclent_t */
#define GETACL 1
#define SETACL 2
#define GETACLCNT 3
/* cmd's to manipulate ace acl's. */
#define ACE_GETACL 4
#define ACE_SETACL 5
#define ACE_GETACLCNT 6
/* minimal acl entries from GETACLCNT */
#define MIN_ACL_ENTRIES 4
#if !defined(_KERNEL)
/* acl check errors */
#define GRP_ERROR 1
#define USER_ERROR 2
#define OTHER_ERROR 3
#define CLASS_ERROR 4
#define DUPLICATE_ERROR 5
#define MISS_ERROR 6
#define MEM_ERROR 7
#define ENTRY_ERROR 8
/*
* similar to ufs_acl.h: changed to char type for user commands (tar, cpio)
* Attribute types
*/
extern aclent_t *aclfromtext(char *, int *);
#else /* !defined(_KERNEL) */
extern int cmp2acls(void *, void *);
#endif /* !defined(_KERNEL) */
#if defined(__STDC__)
#else /* !__STDC__ */
extern int acl();
extern int facl();
#endif /* defined(__STDC__) */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ACL_H */