| 1 | /*
|
|---|
| 2 | Unix SMB/CIFS implementation.
|
|---|
| 3 | Portable SMB ACL interface
|
|---|
| 4 | Copyright (C) Jeremy Allison 2000
|
|---|
| 5 |
|
|---|
| 6 | This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 9 | (at your option) any later version.
|
|---|
| 10 |
|
|---|
| 11 | This program is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with this program; if not, write to the Free Software
|
|---|
| 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef _SMB_ACLS_H
|
|---|
| 22 | #define _SMB_ACLS_H
|
|---|
| 23 |
|
|---|
| 24 | typedef int SMB_ACL_TYPE_T;
|
|---|
| 25 | typedef mode_t *SMB_ACL_PERMSET_T;
|
|---|
| 26 | typedef mode_t SMB_ACL_PERM_T;
|
|---|
| 27 | #define SMB_ACL_READ 4
|
|---|
| 28 | #define SMB_ACL_WRITE 2
|
|---|
| 29 | #define SMB_ACL_EXECUTE 1
|
|---|
| 30 |
|
|---|
| 31 | /* Types of ACLs. */
|
|---|
| 32 | enum smb_acl_tag_t {
|
|---|
| 33 | SMB_ACL_TAG_INVALID=0,
|
|---|
| 34 | SMB_ACL_USER=1,
|
|---|
| 35 | SMB_ACL_USER_OBJ,
|
|---|
| 36 | SMB_ACL_GROUP,
|
|---|
| 37 | SMB_ACL_GROUP_OBJ,
|
|---|
| 38 | SMB_ACL_OTHER,
|
|---|
| 39 | SMB_ACL_MASK
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | typedef enum smb_acl_tag_t SMB_ACL_TAG_T;
|
|---|
| 43 |
|
|---|
| 44 | struct smb_acl_entry {
|
|---|
| 45 | enum smb_acl_tag_t a_type;
|
|---|
| 46 | SMB_ACL_PERM_T a_perm;
|
|---|
| 47 | uid_t uid;
|
|---|
| 48 | gid_t gid;
|
|---|
| 49 | };
|
|---|
| 50 |
|
|---|
| 51 | typedef struct smb_acl_t {
|
|---|
| 52 | int size;
|
|---|
| 53 | int count;
|
|---|
| 54 | int next;
|
|---|
| 55 | struct smb_acl_entry acl[1];
|
|---|
| 56 | } *SMB_ACL_T;
|
|---|
| 57 |
|
|---|
| 58 | typedef struct smb_acl_entry *SMB_ACL_ENTRY_T;
|
|---|
| 59 |
|
|---|
| 60 | #define SMB_ACL_FIRST_ENTRY 0
|
|---|
| 61 | #define SMB_ACL_NEXT_ENTRY 1
|
|---|
| 62 |
|
|---|
| 63 | #define SMB_ACL_TYPE_ACCESS 0
|
|---|
| 64 | #define SMB_ACL_TYPE_DEFAULT 1
|
|---|
| 65 |
|
|---|
| 66 | #endif /* _SMB_ACLS_H */
|
|---|