don't use blacklist if we are crunched.

This commit is contained in:
christos 2015-01-26 03:57:17 +00:00
parent 3808a58b42
commit 6399d84e46
2 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.11 2015/01/25 15:52:44 christos Exp $ # $NetBSD: Makefile,v 1.12 2015/01/26 03:57:17 christos Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
@ -69,5 +69,9 @@ DPADD+= ${LIBCRYPT} ${LIBUTIL}
LDADD+= -lwrap LDADD+= -lwrap
DPADD+= ${LIBWRAP} DPADD+= ${LIBWRAP}
.ifdef CRUNCHEDPROG
CPPFLAGS+=-DSMALL
.else
LDADD+= -lblacklist LDADD+= -lblacklist
DPADD+= ${LIBBLACKLIST} DPADD+= ${LIBBLACKLIST}
.endif

View File

@ -5,17 +5,22 @@
#include "pfilter.h" #include "pfilter.h"
#include <blacklist.h> #include <blacklist.h>
#ifndef SMALL
static struct blacklist *blstate; static struct blacklist *blstate;
#endif
void void
pfilter_init() pfilter_init()
{ {
#ifndef SMALL
blstate = blacklist_open(); blstate = blacklist_open();
#endif
} }
void void
pfilter_notify(int a) pfilter_notify(int a)
{ {
#ifndef SMALL
int fd; int fd;
if (blstate == NULL) if (blstate == NULL)
pfilter_init(); pfilter_init();
@ -24,4 +29,7 @@ pfilter_notify(int a)
// XXX: 3? // XXX: 3?
fd = packet_connection_is_on_socket() ? packet_get_connection_in() : 3; fd = packet_connection_is_on_socket() ? packet_get_connection_in() : 3;
(void)blacklist_r(blstate, a, fd, "ssh"); (void)blacklist_r(blstate, a, fd, "ssh");
#else
__USE(a);
#endif
} }