s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline
[Samba.git] / librpc / idl / smb_acl.idl
blobffd1ee278f82f36ddbee067c92895c234ea186f3
1 /*
2 Unix SMB/CIFS implementation.
3 Portable SMB ACL interface
4 Copyright (C) Jeremy Allison 2000
5 Copyright (C) Andrew Bartlett 2012
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 /*
23 * Allow the smb_acl interface to be pushed into an NDR blob and
24 * read/written in python.
26 * The exact layout of these stuctures is CRITICAL, as a SHA-256 hash is
27 * taken over these after they are pushed as NDR blobs, and stored in an
28 * xattr for ACL verification.
31 pointer_default(unique)
33 interface smb_acl
36 const int SMB_ACL_READ = 4;
37 const int SMB_ACL_WRITE = 2;
38 const int SMB_ACL_EXECUTE = 1;
40 /* Types of ACLs. */
41 typedef enum {
42 SMB_ACL_TAG_INVALID = 0,
43 SMB_ACL_USER = 1,
44 SMB_ACL_USER_OBJ = 2,
45 SMB_ACL_GROUP = 3,
46 SMB_ACL_GROUP_OBJ = 4,
47 SMB_ACL_OTHER = 5,
48 SMB_ACL_MASK = 6
49 } smb_acl_tag_t;
51 typedef struct {
52 uid_t uid;
53 } smb_acl_user;
55 typedef struct {
56 gid_t gid;
57 } smb_acl_group;
59 typedef [switch_type(uint16)] union {
60 [case (SMB_ACL_USER)] smb_acl_user user;
61 [case (SMB_ACL_USER_OBJ)];
62 [case (SMB_ACL_GROUP)] smb_acl_group group;
63 [case (SMB_ACL_GROUP_OBJ)];
64 [case (SMB_ACL_OTHER)];
65 [case (SMB_ACL_MASK)];
66 } smb_acl_entry_info;
68 typedef struct {
69 smb_acl_tag_t a_type;
70 [switch_is(a_type)] smb_acl_entry_info info;
71 mode_t a_perm;
72 } smb_acl_entry;
74 [public] typedef struct {
75 int count;
76 [value(0)] int next;
77 [size_is(count)] smb_acl_entry acl[*];
78 } smb_acl_t;
80 const int SMB_ACL_FIRST_ENTRY = 0;
81 const int SMB_ACL_NEXT_ENTRY = 1;
83 const int SMB_ACL_TYPE_ACCESS = 0;
84 const int SMB_ACL_TYPE_DEFAULT = 1;
86 /* A wrapper of all the information required to reproduce an
87 * ACL, so we can hash it for the acl_xattr and acl_tdb
88 * modules */
89 [public] typedef struct {
90 smb_acl_t *access_acl;
91 smb_acl_t *default_acl; /* NULL on files */
92 uid_t owner;
93 gid_t group;
94 mode_t mode;
95 } smb_acl_wrapper;