summaryrefslogtreecommitdiff
path: root/libexec/ftpd/pfilter.c
blob: 9596e9eaf7131e138a129002e5bdee48508f0f7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <unistd.h>
#include <blacklist.h>

#include "pfilter.h"

static struct blacklist *blstate;

void
pfilter_open(void)
{
	if (blstate == NULL)
		blstate = blacklist_open();
}

void
pfilter_notify(int what, const char *msg)
{
	pfilter_open();

	if (blstate == NULL)
		return;

	blacklist_r(blstate, what, STDIN_FILENO, msg);
}