Windows: cm_BPlusDirNextEnumEntry return all errors
[openafs.git] / src / WINNT / afsd / fs_acl.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef AFS_FS_ACL_H
11 #define AFS_FS_ACL_H
12
13 #define ACL_MAXNAME 100
14
15
16 /*
17  * Character to use between name and rights in printed representation for
18  * DFS ACL's.
19  */
20 #define DFS_SEPARATOR   ' '
21
22 typedef char sec_rgy_name_t[1025];      /* A DCE definition */
23
24 struct Acl {
25     int dfs;            /* Originally true if a dfs acl; now also the type
26                          * of the acl (1, 2, or 3, corresponding to object,
27                          * initial dir, or initial object). */
28     sec_rgy_name_t cell; /* DFS cell name */
29     int nplus;
30     int nminus;
31     struct AclEntry *pluslist;
32     struct AclEntry *minuslist;
33 };
34
35 struct AclEntry {
36     struct AclEntry *next;
37     char name[ACL_MAXNAME];
38     afs_int32 rights;
39 };
40
41 /*
42  * Mods for the AFS/DFS protocol translator.
43  *
44  * DFS rights. It's ugly to put these definitions here, but they
45  * *cannot* change, because they're part of the wire protocol.
46  * In any event, the protocol translator will guarantee these
47  * assignments for AFS cache managers.
48  */
49 #define DFS_READ          0x01
50 #define DFS_WRITE         0x02
51 #define DFS_EXECUTE       0x04
52 #define DFS_CONTROL       0x08
53 #define DFS_INSERT        0x10
54 #define DFS_DELETE        0x20
55
56 /* the application definable ones (backwards from AFS) */
57 #define DFS_USR0 0x80000000      /* "A" bit */
58 #define DFS_USR1 0x40000000      /* "B" bit */
59 #define DFS_USR2 0x20000000      /* "C" bit */
60 #define DFS_USR3 0x10000000      /* "D" bit */
61 #define DFS_USR4 0x08000000      /* "E" bit */
62 #define DFS_USR5 0x04000000      /* "F" bit */
63 #define DFS_USR6 0x02000000      /* "G" bit */
64 #define DFS_USR7 0x01000000      /* "H" bit */
65 #define DFS_USRALL      (DFS_USR0 | DFS_USR1 | DFS_USR2 | DFS_USR3 |\
66                          DFS_USR4 | DFS_USR5 | DFS_USR6 | DFS_USR7)
67
68 /* added relative add resp. delete    */
69 /* (so old add really means to set)   */
70 enum rtype { add, destroy, deny, reladd, reldel };
71
72 extern void ZapList(struct AclEntry *alist);
73
74 extern void ZapAcl(struct Acl *acl);
75
76 extern int PruneList(struct AclEntry **ae, int dfs);
77
78 extern int CleanAcl(struct Acl *aa, char *cellname);
79
80 extern struct Acl *EmptyAcl(char *astr);
81
82 extern struct Acl *ParseAcl (char *astr, int astr_size);
83
84 extern char *AclToString(struct Acl *acl);
85
86 extern void ChangeList (struct Acl *al, afs_int32 plus, char *aname,
87                         afs_int32 arights, enum rtype *artypep);
88
89 extern struct AclEntry *FindList (struct AclEntry *alist, char *aname);
90
91
92 #endif