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 d659a6892..9275e0b7a 100644
--- a/sshd.c
+++ b/sshd.c
@@ -130,6 +130,13 @@
130#include <Security/AuthSession.h> 130#include <Security/AuthSession.h>
131#endif 131#endif
132 132
133#ifdef LIBWRAP
134#include <tcpd.h>
135#include <syslog.h>
136int allow_severity;
137int deny_severity;
138#endif /* LIBWRAP */
139
133#ifndef O_NOCTTY 140#ifndef O_NOCTTY
134#define O_NOCTTY 0 141#define O_NOCTTY 0
135#endif 142#endif
@@ -2151,6 +2158,24 @@ main(int ac, char **av)
2151#ifdef SSH_AUDIT_EVENTS 2158#ifdef SSH_AUDIT_EVENTS
2152 audit_connection_from(remote_ip, remote_port); 2159 audit_connection_from(remote_ip, remote_port);
2153#endif 2160#endif
2161#ifdef LIBWRAP
2162 allow_severity = options.log_facility|LOG_INFO;
2163 deny_severity = options.log_facility|LOG_WARNING;
2164 /* Check whether logins are denied from this host. */
2165 if (packet_connection_is_on_socket()) {
2166 struct request_info req;
2167
2168 request_init(&req, RQ_DAEMON, __progname, RQ_FILE, sock_in, 0);
2169 fromhost(&req);
2170
2171 if (!hosts_access(&req)) {
2172 debug("Connection refused by tcp wrapper");
2173 refuse(&req);
2174 /* NOTREACHED */
2175 fatal("libwrap refuse returns");
2176 }
2177 }
2178#endif /* LIBWRAP */
2154 2179
2155 /* Log the connection. */ 2180 /* Log the connection. */
2156 laddr = get_local_ipaddr(sock_in); 2181 laddr = get_local_ipaddr(sock_in);