]>
Commit | Line | Data |
---|---|---|
1 | #include "squid.h" | |
2 | ||
3 | /* | |
4 | * allowusers.c | |
5 | * (C) 2000 Antonino Iannella, Stellar-X Pty Ltd | |
6 | * Released under GPL, see COPYING-2.0 for details. | |
7 | * | |
8 | * These routines are to allow users attempting to use the proxy which | |
9 | * have been explicitly allowed by the system administrator. | |
10 | * The code originated from denyusers.c. | |
11 | */ | |
12 | ||
13 | #include <stdlib.h> | |
14 | #include <unistd.h> | |
15 | #include <sys/types.h> | |
16 | #include <sys/param.h> | |
17 | #include <string.h> | |
18 | #include "msntauth.h" | |
19 | #include "usersfile.h" | |
20 | ||
21 | static usersfile AllowUsers; | |
22 | static int init = 0; | |
23 | ||
24 | /* shared */ | |
25 | char Allowuserpath[MAXPATHLEN]; /* MAXPATHLEN defined in param.h */ | |
26 | ||
27 | int | |
28 | Read_allowusers(void) | |
29 | { | |
30 | if (!init) { | |
31 | memset(&AllowUsers, '\0', sizeof(AllowUsers)); | |
32 | init = 1; | |
33 | } | |
34 | if (*Allowuserpath) | |
35 | return Read_usersfile(Allowuserpath, &AllowUsers); | |
36 | else | |
37 | return 0; | |
38 | } | |
39 | ||
40 | int | |
41 | Check_ifuserallowed(char *ConnectingUser) | |
42 | { | |
43 | return Check_userlist(&AllowUsers, ConnectingUser); | |
44 | } | |
45 | ||
46 | void | |
47 | Check_forallowchange(void) | |
48 | { | |
49 | Check_forfilechange(&AllowUsers); | |
50 | } |