2 * Copyright 2000, International Business Machines Corporation and others.
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
11 Information Technology Center
12 Carnegie-Mellon University
19 #include "afs/ptint.h"
21 #define ACL_VERSION "Version 1"
23 struct acl_accessEntry {
24 int id; /*internally-used ID of user or group */
29 The above access list entry format is used in VICE
33 #define ACL_ACLVERSION 1 /*Identifies current format of access lists */
35 struct acl_accessList {
36 int size; /*size of this access list in bytes, including MySize itself */
37 int version; /*to deal with upward compatibility ; <= ACL_ACLVERSION */
39 int positive; /* number of positive entries */
40 int negative; /* number of minus entries */
41 struct acl_accessEntry entries[1]; /* negative entries are stored backwards from end */
45 Used in VICE. This is how acccess lists are stored on secondary storage.
49 #define ACL_MAXENTRIES 20
52 * External access lists are just char *'s, with the following format:
54 * Begins with a decimal integer in format "%d\n%d\n" specifying the
55 * number of positive entries and negative entries that follow. This is
56 * followed by the list of entries. Each entry consists of a username or
57 * groupname followed by a decimal number representing the rights mask for
58 * that name. Each entry in the list looks as if it had been produced by
59 * printf() using a format list of "%s\t%d\n".
61 * Note that the number of entries must be less than or equal to ACL_MAXENTRIES
64 /* This is temporary hack to get around changing the volume package for now */
66 typedef struct acl_accessList AL_AccessList;
68 extern int acl_NewACL(int nEntries, struct acl_accessList **acl);
69 extern int acl_FreeACL(struct acl_accessList **acl);
70 extern int acl_NewExternalACL(int nEntries, char **r);
71 extern int acl_FreeExternalACL(char **r);
72 extern int acl_Externalize(struct acl_accessList *acl, char **elist);
73 extern int acl_Internalize(char *elist, struct acl_accessList **acl);
74 extern int acl_Externalize_pr(int (*func)(idlist *ids, namelist *names), struct acl_accessList *acl, char **elist);
75 extern int acl_Internalize_pr(int (*func)(namelist *names, idlist *ids), char *elist, struct acl_accessList **acl);
76 extern int acl_Initialize(char *version);
78 extern int acl_CheckRights(struct acl_accessList *acl, prlist *groups, int *rights);
79 extern int acl_IsAMember(afs_int32 aid, prlist *cps);
82 extern int acl_HtonACL(struct acl_accessList *);
83 extern int acl_NtohACL(struct acl_accessList *);