allowusers.c

来自「功能强大的代理服务器」· C语言 代码 · 共 50 行

C
50
字号
/* * allowusers.c * (C) 2000 Antonino Iannella, Stellar-X Pty Ltd * Released under GPL, see COPYING-2.0 for details. *  * These routines are to allow users attempting to use the proxy which * have been explicitly allowed by the system administrator. * The code originated from denyusers.c. */#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/param.h>#include <string.h>#include "usersfile.h"#include "msntauth.h"static usersfile AllowUsers;static int init = 0;/* shared */char Allowuserpath[MAXPATHLEN];	/* MAXPATHLEN defined in param.h */intRead_allowusers(void){    if (!init) {	memset(&AllowUsers, '\0', sizeof(AllowUsers));	init = 1;    }    if (*Allowuserpath)	return Read_usersfile(Allowuserpath, &AllowUsers);    else	return 0;}intCheck_ifuserallowed(char *ConnectingUser){    return Check_userlist(&AllowUsers, ConnectingUser);}voidCheck_forallowchange(void){    Check_forfilechange(&AllowUsers);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?