reindent-20030715
[openafs.git] / src / libacl / 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 /*
11         Information Technology Center
12         Carnegie-Mellon University
13 */
14
15 #ifndef _ACL_
16 #define _ACL_
17
18
19
20 #define ACL_VERSION "Version 1"
21
22 struct acl_accessEntry {
23     int id;                     /*internally-used ID of user or group */
24     int rights;                 /*mask */
25 };
26
27 /*
28 The above access list entry format is used in VICE
29 */
30
31
32 #define ACL_ACLVERSION  1       /*Identifies current format of access lists */
33
34 struct acl_accessList {
35     int size;                   /*size of this access list in bytes, including MySize itself */
36     int version;                /*to deal with upward compatibility ; <= ACL_ACLVERSION */
37     int total;
38     int positive;               /* number of positive entries */
39     int negative;               /* number of minus entries */
40     struct acl_accessEntry entries[1];  /* negative entries are stored backwards from end */
41 };
42
43 /*
44 Used in VICE. This is how acccess lists are stored on secondary storage.
45 */
46
47
48 #define ACL_MAXENTRIES  20
49
50 /*
51 External access lists are just char *'s, with the following format:  Begins with a decimal integer in format "%d\n%d\n"
52 specifying the number of positive entries and negative entries that follow.  This is followed by the list
53 of entries.  Each entry consists of a
54 username or groupname followed by a decimal number representing the rights mask for that name.  Each
55 entry in the list looks as if it had been produced by printf() using a format list of "%s\t%d\n".
56
57 Note that the number of entries must be less than ACL_MAXENTRIES
58 */
59
60 /* This is temporary hack to get around changing the volume package
61 for now */
62
63 typedef struct acl_accessList AL_AccessList;
64
65 #endif