Coda Distributed File System
al.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15
16 IBM COPYRIGHT NOTICE
17
18 Copyright (C) 1986
19 International Business Machines Corporation
20 All Rights Reserved
21
22This file contains some code identical to or derived from the 1986
23version of the Andrew File System ("AFS"), which is owned by the IBM
24Corporation. This code is provided "AS IS" and IBM does not warrant
25that it is free of infringement of any intellectual rights of any
26third party. IBM disclaims liability of any kind for any damages
27whatsoever resulting directly or indirectly from use of this software
28or of any derivative work. Carnegie Mellon University has obtained
29permission to distribute this code, which is based on Version 2 of AFS
30and does not contain the features and enhancements that are part of
31Version 3 of AFS. Version 3 of AFS is commercially available and
32supported by Transarc Corporation, Pittsburgh, PA.
33
34*/
35
36#ifndef _AL_
37#define _AL_
38
39#define AL_VERSION "AL v2003.05.23"
40
41typedef struct {
42 int Id; /*internally-used ID of user or group*/
43 int Rights; /*mask*/
45/* The above access list entry format is used in VICE */
46
47#define AL_ALISTVERSION 1 /*Identifies current format of access lists*/
48typedef struct {
49 int MySize; /*size of this access list in bytes, including MySize itself*/
50 int Version; /*to deal with upward compatibility */
51 int TotalNoOfEntries; /*no of slots in ActualEntries[ ]; redundant, but convenient */
52 int PlusEntriesInUse; /*stored forwards from ActualEntries[0]*/
53 int MinusEntriesInUse; /*stored forwards from ActualEntries[PlusEntriesInUse]*/
54 AL_AccessEntry ActualEntries[1]; /*Actual array bound is TotalNoOfEntries*/
56/* Used in VICE. This is how acccess lists are stored on secondary storage. */
57
58extern int AL_MaxExtEntries; /* Max number of entries in an external
59 access list */
60#define AL_MAXEXTENTRIES \
61 20 /* Default initial value for
62 AL_MaxExtEntries */
64typedef char *AL_ExternalAccessList;
65/* An ASCII representation of an access list. Begins with two decimal integers
66 in format "%d\n%d\n" specifying the number of Plus entries and Minus entries
67 that follow. This is followed by the list of plus entries and then the list
68 of minus entries. Each entry consists of a username or groupname followed
69 by a decimal number representing the rights mask for that name. Each entry
70 in the list looks as if it had been produced by printf() using a format list
71 of "%s\t%d\n".
72
73 Note that the number of Plus entries and Minus entries must be less than
74 AL_MaxExtEntries, which has the default of AL_MAXEXTENTRIES. You can change
75 this limit at any time by changing AL_MaxExtEntries. */
76
77extern int AL_DebugLevel; /* set for debugging info */
78
79/* Interface definition */
80extern int AL_NewAlist(int MinNoOfEntries, AL_AccessList **Al);
81extern int AL_FreeAlist(AL_AccessList **Al);
84extern int AL_NewExternalAlist(int MinNoOfEntries, AL_ExternalAccessList *R);
86extern int AL_NewCPS(int MinNoOfEntries, PRS_InternalCPS **ICPS);
90extern int AL_NewExternalCPS(int MinNoOfEntries, PRS_ExternalCPS *R);
94extern int AL_CheckRights(AL_AccessList *Alist, PRS_InternalCPS *CPS,
95 int *WhichRights);
96extern int AL_Initialize(const char *Version);
97extern int AL_NameToId(const char *Name, int *Id);
98extern int AL_IdToName(int Id, char *Name);
99extern int AL_GetInternalCPS(int Id, PRS_InternalCPS **ICPS);
100extern int AL_GetExternalCPS(int Id, PRS_ExternalCPS *ECPS);
101extern int AL_IsAMember(int Id, PRS_InternalCPS *ICPS);
104extern int AL_DisableGroup(int gid, PRS_InternalCPS *ICPS);
105extern int AL_EnableGroup(int gid, PRS_InternalCPS *ICPS);
106
109
110#endif
int AL_GetExternalCPS(int Id, PRS_ExternalCPS *ECPS)
int AL_MaxExtEntries
Definition: alprocs.c:69
void AL_PrintExternalAlist(AL_ExternalAccessList E)
int AL_NameToId(const char *Name, int *Id)
int AL_EnableGroup(int gid, PRS_InternalCPS *ICPS)
int AL_FreeExternalCPS(PRS_ExternalCPS *R)
int AL_FreeCPS(PRS_InternalCPS **C)
int AL_htonCPS(PRS_InternalCPS *C)
int AL_Internalize(AL_ExternalAccessList Elist, AL_AccessList **Alist)
void AL_PrintAlist(AL_AccessList *A)
int AL_NewCPS(int MinNoOfEntries, PRS_InternalCPS **ICPS)
int AL_Initialize(const char *Version)
int AL_NewExternalCPS(int MinNoOfEntries, PRS_ExternalCPS *R)
int AL_ntohAlist(AL_AccessList *Al)
int AL_DisableGroup(int gid, PRS_InternalCPS *ICPS)
int AL_Externalize(AL_AccessList *Alist, AL_ExternalAccessList *Elist)
int AL_IsAMember(int Id, PRS_InternalCPS *ICPS)
Definition: alprocs.c:519
int AL_FreeExternalAlist(AL_ExternalAccessList *R)
int CmpMinus(AL_AccessEntry *a, AL_AccessEntry *b)
Definition: alprocs.c:539
int AL_htonAlist(AL_AccessList *Al)
int AL_FreeAlist(AL_AccessList **Al)
int AL_ntohCPS(PRS_InternalCPS *C)
int AL_NewAlist(int MinNoOfEntries, AL_AccessList **Al)
char * AL_ExternalAccessList
Definition: al.h:63
int CmpPlus(AL_AccessEntry *a, AL_AccessEntry *b)
Definition: alprocs.c:530
int AL_NewExternalAlist(int MinNoOfEntries, AL_ExternalAccessList *R)
int AL_CheckRights(AL_AccessList *Alist, PRS_InternalCPS *CPS, int *WhichRights)
int AL_IdToName(int Id, char *Name)
int AL_GetInternalCPS(int Id, PRS_InternalCPS **ICPS)
int AL_DebugLevel
Definition: util.c:74
gid
Definition: pwdtopdbtool.py:46
char * PRS_ExternalCPS
Definition: prs.h:59
@ C
Definition: rp2.h:118
Definition: al.h:41
int Id
Definition: al.h:42
int Rights
Definition: al.h:43
Definition: al.h:48
int MinusEntriesInUse
Definition: al.h:53
int PlusEntriesInUse
Definition: al.h:52
int Version
Definition: al.h:50
int TotalNoOfEntries
Definition: al.h:51
int MySize
Definition: al.h:49
Definition: prs.h:46