comparison svr-main.c @ 246:f4cf0415fec1 contrib-blacklist

- blacklisting patch from Michael Deiters
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Sep 2005 04:52:46 +0000
parents 0cfba3034be5
children c07de41b53d7
comparison
equal deleted inserted replaced
224:1dbd2473482f 246:f4cf0415fec1
26 #include "dbutil.h" 26 #include "dbutil.h"
27 #include "session.h" 27 #include "session.h"
28 #include "buffer.h" 28 #include "buffer.h"
29 #include "signkey.h" 29 #include "signkey.h"
30 #include "runopts.h" 30 #include "runopts.h"
31 #include "blacklist.h"
31 32
32 static int listensockets(int *sock, int sockcount, int *maxfd); 33 static int listensockets(int *sock, int sockcount, int *maxfd);
33 static void sigchld_handler(int dummy); 34 static void sigchld_handler(int dummy);
34 static void sigsegv_handler(int); 35 static void sigsegv_handler(int);
35 static void sigintterm_handler(int fish); 36 static void sigintterm_handler(int fish);
236 if (childpipes[j] < 0) { 237 if (childpipes[j] < 0) {
237 break; 238 break;
238 } 239 }
239 } 240 }
240 241
242 if (is_blacklisted(getaddrstring(&remoteaddr, 0)) == 1) {
243 close(childsock);
244 continue;
245 }
246
241 if (j == MAX_UNAUTH_CLIENTS) { 247 if (j == MAX_UNAUTH_CLIENTS) {
242 /* no free connections */ 248 /* no free connections */
243 /* TODO - possibly log, though this would be an easy way 249 /* TODO - possibly log, though this would be an easy way
244 * to fill logs/disk */ 250 * to fill logs/disk */
245 close(childsock); 251 close(childsock);