File tcp_wrappers_7.6-fedora-sig.diff of Package tcpd (Revision 6db032154cf0ef8f92650425c7984370)
Currently displaying revision 6db032154cf0ef8f92650425c7984370 , Show latest
40
1
--- hosts_access.c.orig
2
+++ hosts_access.c
3
4
5
#define YES 1
6
#define NO 0
7
+#define ERR -1
8
9
/*
10
* These variables are globally visible so that they can be redirected in
11
12
struct request_info *request;
13
{
14
int verdict;
15
-
16
/*
17
* If the (daemon, client) pair is matched by an entry in the file
18
* /etc/hosts.allow, access is granted. Otherwise, if the (daemon,
19
20
return (verdict == AC_PERMIT);
21
if (table_match(hosts_allow_table, request) == YES)
22
return (YES);
23
- if (table_match(hosts_deny_table, request))
24
- return (NO);
25
- return (YES);
26
+ if (table_match(hosts_deny_table, request) == NO)
27
+ return (YES);
28
+ return (NO);
29
}
30
31
/* table_match - match table entries with (daemon, client) pair */
32
33
(void) fclose(fp);
34
} else if (errno != ENOENT) {
35
tcpd_warn("cannot open %s: %m", table);
36
+ match = ERR;
37
}
38
if (match == YES) {
39
if (hosts_access_verbose > 1)
40