vsftpd 2.0.7 - initial checkin.
[tomato.git] / release / src / router / vsftpd / tcpwrap.c
blob3b37e0410525ab60b8cb88d4055ab954a8851dfe
1 /*
2 * Part of Very Secure FTPd
3 * Licence: GPL v2
4 * Author: Chris Evans
5 * tcpwrap.c
7 * Routines to encapsulate the usage of tcp_wrappers.
8 */
10 #include "tcpwrap.h"
11 #include "builddefs.h"
12 #include "utility.h"
14 #ifdef VSF_BUILD_TCPWRAPPERS
15 #include <tcpd.h>
16 #endif
18 #ifdef VSF_BUILD_TCPWRAPPERS
20 #include <sys/syslog.h>
22 int deny_severity = LOG_WARNING;
23 int allow_severity = LOG_INFO;
25 int
26 vsf_tcp_wrapper_ok(int remote_fd)
28 struct request_info req;
29 request_init(&req, RQ_DAEMON, "vsftpd", RQ_FILE, remote_fd, 0);
30 fromhost(&req);
31 if (!hosts_access(&req))
33 return 0;
35 return 1;
38 #else /* VSF_BUILD_TCPWRAPPERS */
40 int
41 vsf_tcp_wrapper_ok(int remote_fd)
43 (void) remote_fd;
44 die("tcp_wrappers is set to YES but no tcp wrapper support compiled in");
45 return 0;
48 #endif /* VSF_BUILD_TCPWRAPPERS */