1*eda14cbcSMatt Macy /* 2*eda14cbcSMatt Macy * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. 3*eda14cbcSMatt Macy * Copyright (C) 2007 The Regents of the University of California. 4*eda14cbcSMatt Macy * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). 5*eda14cbcSMatt Macy * Written by Brian Behlendorf <behlendorf1@llnl.gov>. 6*eda14cbcSMatt Macy * UCRL-CODE-235197 7*eda14cbcSMatt Macy * 8*eda14cbcSMatt Macy * This file is part of the SPL, Solaris Porting Layer. 9*eda14cbcSMatt Macy * 10*eda14cbcSMatt Macy * The SPL is free software; you can redistribute it and/or modify it 11*eda14cbcSMatt Macy * under the terms of the GNU General Public License as published by the 12*eda14cbcSMatt Macy * Free Software Foundation; either version 2 of the License, or (at your 13*eda14cbcSMatt Macy * option) any later version. 14*eda14cbcSMatt Macy * 15*eda14cbcSMatt Macy * The SPL is distributed in the hope that it will be useful, but WITHOUT 16*eda14cbcSMatt Macy * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17*eda14cbcSMatt Macy * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 18*eda14cbcSMatt Macy * for more details. 19*eda14cbcSMatt Macy * 20*eda14cbcSMatt Macy * You should have received a copy of the GNU General Public License along 21*eda14cbcSMatt Macy * with the SPL. If not, see <http://www.gnu.org/licenses/>. 22*eda14cbcSMatt Macy */ 23*eda14cbcSMatt Macy 24*eda14cbcSMatt Macy #ifndef _SPL_ACL_H 25*eda14cbcSMatt Macy #define _SPL_ACL_H 26*eda14cbcSMatt Macy 27*eda14cbcSMatt Macy #include <sys/types.h> 28*eda14cbcSMatt Macy 29*eda14cbcSMatt Macy typedef struct ace { 30*eda14cbcSMatt Macy uid_t a_who; 31*eda14cbcSMatt Macy uint32_t a_access_mask; 32*eda14cbcSMatt Macy uint16_t a_flags; 33*eda14cbcSMatt Macy uint16_t a_type; 34*eda14cbcSMatt Macy } ace_t; 35*eda14cbcSMatt Macy 36*eda14cbcSMatt Macy typedef struct ace_object { 37*eda14cbcSMatt Macy uid_t a_who; /* uid or gid */ 38*eda14cbcSMatt Macy uint32_t a_access_mask; /* read,write,... */ 39*eda14cbcSMatt Macy uint16_t a_flags; /* see below */ 40*eda14cbcSMatt Macy uint16_t a_type; /* allow or deny */ 41*eda14cbcSMatt Macy uint8_t a_obj_type[16]; /* obj type */ 42*eda14cbcSMatt Macy uint8_t a_inherit_obj_type[16]; /* inherit obj */ 43*eda14cbcSMatt Macy } ace_object_t; 44*eda14cbcSMatt Macy 45*eda14cbcSMatt Macy #define MAX_ACL_ENTRIES 1024 46*eda14cbcSMatt Macy 47*eda14cbcSMatt Macy #define ACE_READ_DATA 0x00000001 48*eda14cbcSMatt Macy #define ACE_LIST_DIRECTORY 0x00000001 49*eda14cbcSMatt Macy #define ACE_WRITE_DATA 0x00000002 50*eda14cbcSMatt Macy #define ACE_ADD_FILE 0x00000002 51*eda14cbcSMatt Macy #define ACE_APPEND_DATA 0x00000004 52*eda14cbcSMatt Macy #define ACE_ADD_SUBDIRECTORY 0x00000004 53*eda14cbcSMatt Macy #define ACE_READ_NAMED_ATTRS 0x00000008 54*eda14cbcSMatt Macy #define ACE_WRITE_NAMED_ATTRS 0x00000010 55*eda14cbcSMatt Macy #define ACE_EXECUTE 0x00000020 56*eda14cbcSMatt Macy #define ACE_DELETE_CHILD 0x00000040 57*eda14cbcSMatt Macy #define ACE_READ_ATTRIBUTES 0x00000080 58*eda14cbcSMatt Macy #define ACE_WRITE_ATTRIBUTES 0x00000100 59*eda14cbcSMatt Macy #define ACE_DELETE 0x00010000 60*eda14cbcSMatt Macy #define ACE_READ_ACL 0x00020000 61*eda14cbcSMatt Macy #define ACE_WRITE_ACL 0x00040000 62*eda14cbcSMatt Macy #define ACE_WRITE_OWNER 0x00080000 63*eda14cbcSMatt Macy #define ACE_SYNCHRONIZE 0x00100000 64*eda14cbcSMatt Macy 65*eda14cbcSMatt Macy #define ACE_FILE_INHERIT_ACE 0x0001 66*eda14cbcSMatt Macy #define ACE_DIRECTORY_INHERIT_ACE 0x0002 67*eda14cbcSMatt Macy #define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 68*eda14cbcSMatt Macy #define ACE_INHERIT_ONLY_ACE 0x0008 69*eda14cbcSMatt Macy #define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010 70*eda14cbcSMatt Macy #define ACE_FAILED_ACCESS_ACE_FLAG 0x0020 71*eda14cbcSMatt Macy #define ACE_IDENTIFIER_GROUP 0x0040 72*eda14cbcSMatt Macy #define ACE_INHERITED_ACE 0x0080 73*eda14cbcSMatt Macy #define ACE_OWNER 0x1000 74*eda14cbcSMatt Macy #define ACE_GROUP 0x2000 75*eda14cbcSMatt Macy #define ACE_EVERYONE 0x4000 76*eda14cbcSMatt Macy 77*eda14cbcSMatt Macy #define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000 78*eda14cbcSMatt Macy #define ACE_ACCESS_DENIED_ACE_TYPE 0x0001 79*eda14cbcSMatt Macy #define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002 80*eda14cbcSMatt Macy #define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003 81*eda14cbcSMatt Macy 82*eda14cbcSMatt Macy #define ACL_AUTO_INHERIT 0x0001 83*eda14cbcSMatt Macy #define ACL_PROTECTED 0x0002 84*eda14cbcSMatt Macy #define ACL_DEFAULTED 0x0004 85*eda14cbcSMatt Macy #define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED) 86*eda14cbcSMatt Macy 87*eda14cbcSMatt Macy #define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04 88*eda14cbcSMatt Macy #define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05 89*eda14cbcSMatt Macy #define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06 90*eda14cbcSMatt Macy #define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07 91*eda14cbcSMatt Macy #define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08 92*eda14cbcSMatt Macy #define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09 93*eda14cbcSMatt Macy #define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A 94*eda14cbcSMatt Macy #define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B 95*eda14cbcSMatt Macy #define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C 96*eda14cbcSMatt Macy #define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D 97*eda14cbcSMatt Macy #define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E 98*eda14cbcSMatt Macy #define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F 99*eda14cbcSMatt Macy #define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10 100*eda14cbcSMatt Macy 101*eda14cbcSMatt Macy #define ACE_ALL_TYPES 0x001F 102*eda14cbcSMatt Macy 103*eda14cbcSMatt Macy #define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP) 104*eda14cbcSMatt Macy 105*eda14cbcSMatt Macy #define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \ 106*eda14cbcSMatt Macy ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS|\ 107*eda14cbcSMatt Macy ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES|\ 108*eda14cbcSMatt Macy ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \ 109*eda14cbcSMatt Macy ACE_WRITE_OWNER|ACE_SYNCHRONIZE) 110*eda14cbcSMatt Macy 111*eda14cbcSMatt Macy #define VSA_ACE 0x0010 112*eda14cbcSMatt Macy #define VSA_ACECNT 0x0020 113*eda14cbcSMatt Macy #define VSA_ACE_ALLTYPES 0x0040 114*eda14cbcSMatt Macy #define VSA_ACE_ACLFLAGS 0x0080 115*eda14cbcSMatt Macy 116*eda14cbcSMatt Macy #endif /* _SPL_ACL_H */ 117