diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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> | ||
133 | int allow_severity; | ||
134 | int 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) |
@@ -2057,6 +2064,24 @@ main(int ac, char **av) | |||
2057 | #ifdef SSH_AUDIT_EVENTS | 2064 | #ifdef SSH_AUDIT_EVENTS |
2058 | audit_connection_from(remote_ip, remote_port); | 2065 | audit_connection_from(remote_ip, remote_port); |
2059 | #endif | 2066 | #endif |
2067 | #ifdef LIBWRAP | ||
2068 | allow_severity = options.log_facility|LOG_INFO; | ||
2069 | deny_severity = options.log_facility|LOG_WARNING; | ||
2070 | /* Check whether logins are denied from this host. */ | ||
2071 | if (ssh_packet_connection_is_on_socket(ssh)) { | ||
2072 | struct request_info req; | ||
2073 | |||
2074 | request_init(&req, RQ_DAEMON, __progname, RQ_FILE, sock_in, 0); | ||
2075 | fromhost(&req); | ||
2076 | |||
2077 | if (!hosts_access(&req)) { | ||
2078 | debug("Connection refused by tcp wrapper"); | ||
2079 | refuse(&req); | ||
2080 | /* NOTREACHED */ | ||
2081 | fatal("libwrap refuse returns"); | ||
2082 | } | ||
2083 | } | ||
2084 | #endif /* LIBWRAP */ | ||
2060 | 2085 | ||
2061 | rdomain = ssh_packet_rdomain_in(ssh); | 2086 | rdomain = ssh_packet_rdomain_in(ssh); |
2062 | 2087 | ||