summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sshd.c b/sshd.c
index ebb88c776..982e5455e 100644
--- a/sshd.c
+++ b/sshd.c
@@ -129,6 +129,13 @@
129#include <Security/AuthSession.h> 129#include <Security/AuthSession.h>
130#endif 130#endif
131 131
132#ifdef LIBWRAP
133#include <tcpd.h>
134#include <syslog.h>
135int allow_severity;
136int deny_severity;
137#endif /* LIBWRAP */
138
132#ifndef O_NOCTTY 139#ifndef O_NOCTTY
133#define O_NOCTTY 0 140#define O_NOCTTY 0
134#endif 141#endif
@@ -2207,6 +2214,24 @@ main(int ac, char **av)
2207#ifdef SSH_AUDIT_EVENTS 2214#ifdef SSH_AUDIT_EVENTS
2208 audit_connection_from(remote_ip, remote_port); 2215 audit_connection_from(remote_ip, remote_port);
2209#endif 2216#endif
2217#ifdef LIBWRAP
2218 allow_severity = options.log_facility|LOG_INFO;
2219 deny_severity = options.log_facility|LOG_WARNING;
2220 /* Check whether logins are denied from this host. */
2221 if (packet_connection_is_on_socket()) {
2222 struct request_info req;
2223
2224 request_init(&req, RQ_DAEMON, __progname, RQ_FILE, sock_in, 0);
2225 fromhost(&req);
2226
2227 if (!hosts_access(&req)) {
2228 debug("Connection refused by tcp wrapper");
2229 refuse(&req);
2230 /* NOTREACHED */
2231 fatal("libwrap refuse returns");
2232 }
2233 }
2234#endif /* LIBWRAP */
2210 2235
2211 /* Log the connection. */ 2236 /* Log the connection. */
2212 laddr = get_local_ipaddr(sock_in); 2237 laddr = get_local_ipaddr(sock_in);