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 | #ifndef O_NOCTTY | 137 | #ifndef O_NOCTTY |
131 | #define O_NOCTTY 0 | 138 | #define O_NOCTTY 0 |
132 | #endif | 139 | #endif |
@@ -2061,6 +2068,24 @@ main(int ac, char **av) | |||
2061 | #ifdef SSH_AUDIT_EVENTS | 2068 | #ifdef SSH_AUDIT_EVENTS |
2062 | audit_connection_from(remote_ip, remote_port); | 2069 | audit_connection_from(remote_ip, remote_port); |
2063 | #endif | 2070 | #endif |
2071 | #ifdef LIBWRAP | ||
2072 | allow_severity = options.log_facility|LOG_INFO; | ||
2073 | deny_severity = options.log_facility|LOG_WARNING; | ||
2074 | /* Check whether logins are denied from this host. */ | ||
2075 | if (packet_connection_is_on_socket()) { | ||
2076 | struct request_info req; | ||
2077 | |||
2078 | request_init(&req, RQ_DAEMON, __progname, RQ_FILE, sock_in, 0); | ||
2079 | fromhost(&req); | ||
2080 | |||
2081 | if (!hosts_access(&req)) { | ||
2082 | debug("Connection refused by tcp wrapper"); | ||
2083 | refuse(&req); | ||
2084 | /* NOTREACHED */ | ||
2085 | fatal("libwrap refuse returns"); | ||
2086 | } | ||
2087 | } | ||
2088 | #endif /* LIBWRAP */ | ||
2064 | 2089 | ||
2065 | /* Log the connection. */ | 2090 | /* Log the connection. */ |
2066 | verbose("Connection from %s port %d on %s port %d", | 2091 | verbose("Connection from %s port %d on %s port %d", |