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 20a7a5f33..38cf9b493 100644
--- a/sshd.c
+++ b/sshd.c
@@ -127,6 +127,13 @@
127#include <Security/AuthSession.h> 127#include <Security/AuthSession.h>
128#endif 128#endif
129 129
130#ifdef LIBWRAP
131#include <tcpd.h>
132#include <syslog.h>
133int allow_severity;
134int deny_severity;
135#endif /* LIBWRAP */
136
130/* Re-exec fds */ 137/* Re-exec fds */
131#define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) 138#define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1)
132#define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2) 139#define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2)
@@ -1992,6 +1999,24 @@ main(int ac, char **av)
1992#ifdef SSH_AUDIT_EVENTS 1999#ifdef SSH_AUDIT_EVENTS
1993 audit_connection_from(remote_ip, remote_port); 2000 audit_connection_from(remote_ip, remote_port);
1994#endif 2001#endif
2002#ifdef LIBWRAP
2003 allow_severity = options.log_facility|LOG_INFO;
2004 deny_severity = options.log_facility|LOG_WARNING;
2005 /* Check whether logins are denied from this host. */
2006 if (packet_connection_is_on_socket()) {
2007 struct request_info req;
2008
2009 request_init(&req, RQ_DAEMON, __progname, RQ_FILE, sock_in, 0);
2010 fromhost(&req);
2011
2012 if (!hosts_access(&req)) {
2013 debug("Connection refused by tcp wrapper");
2014 refuse(&req);
2015 /* NOTREACHED */
2016 fatal("libwrap refuse returns");
2017 }
2018 }
2019#endif /* LIBWRAP */
1995 2020
1996 /* Log the connection. */ 2021 /* Log the connection. */
1997 laddr = get_local_ipaddr(sock_in); 2022 laddr = get_local_ipaddr(sock_in);