]>
Commit | Line | Data |
---|---|---|
f7f3304a | 1 | #include "squid.h" |
94439e4e | 2 | |
3 | /* | |
4 | * allowusers.c | |
5 | * (C) 2000 Antonino Iannella, Stellar-X Pty Ltd | |
6 | * Released under GPL, see COPYING-2.0 for details. | |
26ac0430 | 7 | * |
94439e4e | 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 | ||
94439e4e | 13 | #include <stdlib.h> |
94439e4e | 14 | #include <unistd.h> |
eb073b3b | 15 | #include <sys/types.h> |
94439e4e | 16 | #include <sys/param.h> |
c06f9773 | 17 | #include <string.h> |
c06f9773 | 18 | #include "msntauth.h" |
602d9612 | 19 | #include "usersfile.h" |
94439e4e | 20 | |
eb073b3b | 21 | static usersfile AllowUsers; |
22 | static int init = 0; | |
94439e4e | 23 | |
eb073b3b | 24 | /* shared */ |
94439e4e | 25 | char Allowuserpath[MAXPATHLEN]; /* MAXPATHLEN defined in param.h */ |
26 | ||
94439e4e | 27 | int |
eb073b3b | 28 | Read_allowusers(void) |
94439e4e | 29 | { |
eb073b3b | 30 | if (!init) { |
26ac0430 AJ |
31 | memset(&AllowUsers, '\0', sizeof(AllowUsers)); |
32 | init = 1; | |
94439e4e | 33 | } |
811c6e76 | 34 | if (*Allowuserpath) |
26ac0430 | 35 | return Read_usersfile(Allowuserpath, &AllowUsers); |
811c6e76 | 36 | else |
26ac0430 | 37 | return 0; |
94439e4e | 38 | } |
39 | ||
94439e4e | 40 | int |
41 | Check_ifuserallowed(char *ConnectingUser) | |
42 | { | |
eb073b3b | 43 | return Check_userlist(&AllowUsers, ConnectingUser); |
94439e4e | 44 | } |
45 | ||
94439e4e | 46 | void |
eb073b3b | 47 | Check_forallowchange(void) |
94439e4e | 48 | { |
eb073b3b | 49 | Check_forfilechange(&AllowUsers); |
94439e4e | 50 | } |