]> git.ipfire.org Git - thirdparty/squid.git/blame - helpers/basic_auth/MSNT/allowusers.cc
SourceFormat Enforcement
[thirdparty/squid.git] / helpers / basic_auth / MSNT / allowusers.cc
CommitLineData
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 21static usersfile AllowUsers;
22static int init = 0;
94439e4e 23
eb073b3b 24/* shared */
94439e4e 25char Allowuserpath[MAXPATHLEN]; /* MAXPATHLEN defined in param.h */
26
94439e4e 27int
eb073b3b 28Read_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 40int
41Check_ifuserallowed(char *ConnectingUser)
42{
eb073b3b 43 return Check_userlist(&AllowUsers, ConnectingUser);
94439e4e 44}
45
94439e4e 46void
eb073b3b 47Check_forallowchange(void)
94439e4e 48{
eb073b3b 49 Check_forfilechange(&AllowUsers);
94439e4e 50}