00001 /* 00002 Unix SMB/CIFS implementation. 00003 Portable SMB ACL interface 00004 Copyright (C) Jeremy Allison 2000 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef _SMB_ACLS_H 00022 #define _SMB_ACLS_H 00023 00024 typedef int SMB_ACL_TYPE_T; 00025 typedef mode_t *SMB_ACL_PERMSET_T; 00026 typedef mode_t SMB_ACL_PERM_T; 00027 #define SMB_ACL_READ 4 00028 #define SMB_ACL_WRITE 2 00029 #define SMB_ACL_EXECUTE 1 00030 00031 /* Types of ACLs. */ 00032 enum smb_acl_tag_t { 00033 SMB_ACL_TAG_INVALID=0, 00034 SMB_ACL_USER=1, 00035 SMB_ACL_USER_OBJ, 00036 SMB_ACL_GROUP, 00037 SMB_ACL_GROUP_OBJ, 00038 SMB_ACL_OTHER, 00039 SMB_ACL_MASK 00040 }; 00041 00042 typedef enum smb_acl_tag_t SMB_ACL_TAG_T; 00043 00044 struct smb_acl_entry { 00045 enum smb_acl_tag_t a_type; 00046 SMB_ACL_PERM_T a_perm; 00047 uid_t uid; 00048 gid_t gid; 00049 }; 00050 00051 typedef struct smb_acl_t { 00052 int size; 00053 int count; 00054 int next; 00055 struct smb_acl_entry acl[1]; 00056 } *SMB_ACL_T; 00057 00058 typedef struct smb_acl_entry *SMB_ACL_ENTRY_T; 00059 00060 #define SMB_ACL_FIRST_ENTRY 0 00061 #define SMB_ACL_NEXT_ENTRY 1 00062 00063 #define SMB_ACL_TYPE_ACCESS 0 00064 #define SMB_ACL_TYPE_DEFAULT 1 00065 00066 #endif /* _SMB_ACLS_H */