[X2serv-cvs] CVS: x2/source parse.c,1.57,1.58 server.c,1.13,1.14 server.h,1.7,1.8
Brought to you by:
sirvulcan
From: Richard P. <lys...@us...> - 2001-02-28 10:10:10
|
Update of /cvsroot/x2serv/x2/source In directory usw-pr-cvs1:/tmp/cvs-serv26037 Modified Files: parse.c server.c server.h Log Message: x2 checks if connecting clients are on the gline list and resends the gline if they are Index: parse.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/parse.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -r1.57 -r1.58 *** parse.c 2001/02/15 02:36:43 1.57 --- parse.c 2001/02/28 10:11:29 1.58 *************** *** 372,376 **** { char* dq = unsigned32ToDotQuad(IP); ! if(!SuperGlineCheck(UserPtr, dq)) BeginGateScan(UserPtr, dq); } --- 372,376 ---- { char* dq = unsigned32ToDotQuad(IP); ! if(!GlineCheck(UserPtr, dq) && !SuperGlineCheck(UserPtr, dq)) BeginGateScan(UserPtr, dq); } *************** *** 535,544 **** int m_gline(M_PARAMS) { ! char* Arg[7]; Arg[2] = (char *) strtok(rest, " "); /* Target (*) */ Arg[3] = (char *) strtok(NULL, " "); /* +/-*@* */ Arg[4] = (char *) strtok(NULL, " "); /* Time */ ! Arg[5] = (char *) strtok(NULL, " "); /* : */ ! Arg[6] = (char *) strtok(NULL, "\0"); /* Reason */ if (Arg[3][0] == '+') { --- 535,543 ---- int m_gline(M_PARAMS) { ! char* Arg[6]; Arg[2] = (char *) strtok(rest, " "); /* Target (*) */ Arg[3] = (char *) strtok(NULL, " "); /* +/-*@* */ Arg[4] = (char *) strtok(NULL, " "); /* Time */ ! Arg[5] = (char *) strtok(NULL, "\0"); /* :<nick> Reason */ if (Arg[3][0] == '+') { *************** *** 546,550 **** if (!Arg[4]) return (0); /* Invalid no time.. */ ! ProcessAddGline(&Arg[3][1], atoi(Arg[4]), Arg[6]); if(time(NULL) > gwritets + 60) { --- 545,549 ---- if (!Arg[4]) return (0); /* Invalid no time.. */ ! ProcessAddGline(&Arg[3][1], atoi(Arg[4]), Arg[5] + 1); if(time(NULL) > gwritets + 60) { Index: server.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/server.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** server.c 2001/02/15 02:43:16 1.13 --- server.c 2001/02/28 10:11:29 1.14 *************** *** 70,73 **** --- 70,95 ---- } + int GlineCheck(UserListType UserPtr, char *IP) + { + char uhr[MAXLEN]; + GlineListType *gptr; + + if(UserPtr == NULL) + return(FALSE); + sprintf(uhr, "%s@%s", UserPtr->UserID, UserPtr->Address); + + gptr = Glines; + while(gptr) + { + if(!matches(gptr->address, uhr) && gptr->time > NetTime()) + { + send_gline(gptr->address, gptr->time - NetTime(), "%s", gptr->reason); + return(TRUE); + } + gptr = gptr->Next; + } + return(FALSE); + } + int SuperGlineCheck(UserListType UserPtr, char *IP) { *************** *** 82,87 **** gptr = SuperGlines; - if(!gptr) - return(FALSE); while(gptr) { --- 104,107 ---- Index: server.h =================================================================== RCS file: /cvsroot/x2serv/x2/source/server.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** server.h 2001/01/02 10:11:33 1.7 --- server.h 2001/02/28 10:11:29 1.8 *************** *** 1,2 **** --- 1,3 ---- + int GlineCheck(UserListType UserPtr, char *IP); int SuperGlineCheck(UserListType UserPtr, char *IP); GlineListType *GetGline(char *Address); |