diff -pur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6-fix/hosts_access.c --- tcp_wrappers_7.6/hosts_access.c 1997-02-12 02:13:23.000000000 +0100 +++ tcp_wrappers_7.6-fix/hosts_access.c 2005-09-13 16:11:41.000000000 +0200 @@ -57,6 +57,7 @@ static char sep[] = ", \t\r\n"; #define YES 1 #define NO 0 +#define ERR -1 /* * These variables are globally visible so that they can be redirected in @@ -114,11 +115,11 @@ struct request_info *request; verdict = setjmp(tcpd_buf); if (verdict != 0) return (verdict == AC_PERMIT); - if (table_match(hosts_allow_table, request)) + if (table_match(hosts_allow_table, request) == YES) return (YES); - if (table_match(hosts_deny_table, request)) - return (NO); - return (YES); + if (table_match(hosts_deny_table, request) == NO) + return (YES); + return (NO); } /* table_match - match table entries with (daemon, client) pair */ @@ -162,8 +163,9 @@ struct request_info *request; (void) fclose(fp); } else if (errno != ENOENT) { tcpd_warn("cannot open %s: %m", table); + match = ERR; } - if (match) { + if (match == YES) { if (hosts_access_verbose > 1) syslog(LOG_DEBUG, "matched: %s line %d", tcpd_context.file, tcpd_context.line);