1 | /* $Id: al.h,v 1.5 1998-05-07 17:08:38 ghudson Exp $ */ |
---|
2 | |
---|
3 | /* Copyright 1997, 1998 by the Massachusetts Institute of Technology. |
---|
4 | * |
---|
5 | * Permission to use, copy, modify, and distribute this |
---|
6 | * software and its documentation for any purpose and without |
---|
7 | * fee is hereby granted, provided that the above copyright |
---|
8 | * notice appear in all copies and that both that copyright |
---|
9 | * notice and this permission notice appear in supporting |
---|
10 | * documentation, and that the name of M.I.T. not be used in |
---|
11 | * advertising or publicity pertaining to distribution of the |
---|
12 | * software without specific, written prior permission. |
---|
13 | * M.I.T. makes no representations about the suitability of |
---|
14 | * this software for any purpose. It is provided "as is" |
---|
15 | * without express or implied warranty. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef AL__H |
---|
19 | #define AL__H |
---|
20 | |
---|
21 | #include <sys/types.h> |
---|
22 | |
---|
23 | /* Exported path name. */ |
---|
24 | #define AL_PATH_SESSIONS "/var/athena/sessions" |
---|
25 | |
---|
26 | /* Error values */ |
---|
27 | #define AL_SUCCESS 0 |
---|
28 | #define AL_WARNINGS 1 |
---|
29 | #define AL_EBADHES 2 |
---|
30 | #define AL_ENOUSER 3 |
---|
31 | #define AL_ENOCREATE 4 |
---|
32 | #define AL_ENOLOGIN 5 |
---|
33 | #define AL_ENOREMOTE 6 |
---|
34 | #define AL_EPASSWD 7 |
---|
35 | #define AL_ESESSION 8 |
---|
36 | #define AL_EPERM 9 |
---|
37 | #define AL_ENOENT 10 |
---|
38 | #define AL_ENOMEM 11 |
---|
39 | |
---|
40 | /* Warning values */ |
---|
41 | #define AL_ISWARNING(n) (AL_WBADSESSION <= (n) && (n) <= AL_WNOATTACH) |
---|
42 | #define AL_WBADSESSION 12 |
---|
43 | #define AL_WGROUP 13 |
---|
44 | #define AL_WXTMPDIR 14 |
---|
45 | #define AL_WTMPDIR 15 |
---|
46 | #define AL_WNOHOMEDIR 16 |
---|
47 | #define AL_WNOATTACH 17 |
---|
48 | |
---|
49 | /* Public functions */ |
---|
50 | int al_login_allowed(const char *username, int isremote, int *local_acct, |
---|
51 | char **text); |
---|
52 | int al_acct_create(const char *username, const char *cryptpw, |
---|
53 | pid_t sessionpid, int havecred, int tmphomedir, |
---|
54 | int **warnings); |
---|
55 | int al_acct_revert(const char *username, pid_t sessionpid); |
---|
56 | int al_acct_cleanup(const char *username); |
---|
57 | const char *al_strerror(int code, char **mem); |
---|
58 | void al_free_errmem(char *mem); |
---|
59 | int al_get_access(const char *username, char **access, char **text); |
---|
60 | int al_is_local_acct(const char *username); |
---|
61 | |
---|
62 | #endif |
---|