NetBSD/libexec/ftpd/pfilter.c
lukem fc9234654d clarify the fd used for blacklisting.
Use STDIN_FILENO instead of 0 as the fd to blacklist_r(),
since we use the former in ftpd.c
2019-01-29 23:19:30 +00:00

26 lines
351 B
C

#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);
}