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 d92f03aaf..62dc55cf2 100644
--- a/sshd.c
+++ b/sshd.c
@@ -124,6 +124,13 @@
124#include "ssherr.h" 124#include "ssherr.h"
125#include "sk-api.h" 125#include "sk-api.h"
126 126
127#ifdef LIBWRAP
128#include <tcpd.h>
129#include <syslog.h>
130int allow_severity;
131int deny_severity;
132#endif /* LIBWRAP */
133
127/* Re-exec fds */ 134/* Re-exec fds */
128#define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) 135#define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1)
129#define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2) 136#define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2)
@@ -2138,6 +2145,24 @@ main(int ac, char **av)
2138#ifdef SSH_AUDIT_EVENTS 2145#ifdef SSH_AUDIT_EVENTS
2139 audit_connection_from(remote_ip, remote_port); 2146 audit_connection_from(remote_ip, remote_port);
2140#endif 2147#endif
2148#ifdef LIBWRAP
2149 allow_severity = options.log_facility|LOG_INFO;
2150 deny_severity = options.log_facility|LOG_WARNING;
2151 /* Check whether logins are denied from this host. */
2152 if (ssh_packet_connection_is_on_socket(ssh)) {
2153 struct request_info req;
2154
2155 request_init(&req, RQ_DAEMON, __progname, RQ_FILE, sock_in, 0);
2156 fromhost(&req);
2157
2158 if (!hosts_access(&req)) {
2159 debug("Connection refused by tcp wrapper");
2160 refuse(&req);
2161 /* NOTREACHED */
2162 fatal("libwrap refuse returns");
2163 }
2164 }
2165#endif /* LIBWRAP */
2141 2166
2142 rdomain = ssh_packet_rdomain_in(ssh); 2167 rdomain = ssh_packet_rdomain_in(ssh);
2143 2168