]> git.pld-linux.org Git - packages/tcp_wrappers.git/blob - tcp_wrappers-sig.patch
- rediffed
[packages/tcp_wrappers.git] / tcp_wrappers-sig.patch
1 - security, barf in case of problems with hosts.allow/deny files
2 --- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100
3 +++ tcp_wrappers_7.6/hosts_access.c     2003-02-10 16:50:38.000000000 +0100
4 @@ -66,6 +66,7 @@
5  
6  #define        YES             1
7  #define        NO              0
8 +#define        ERR             -1
9  
10   /*
11    * These variables are globally visible so that they can be redirected in
12 @@ -129,11 +129,11 @@
13      verdict = setjmp(tcpd_buf);
14      if (verdict != 0)
15         return (verdict == AC_PERMIT);
16 -    if (table_match(hosts_allow_table, request))
17 +    if (table_match(hosts_allow_table, request) == YES)
18         return (YES);
19 -    if (table_match(hosts_deny_table, request))
20 -       return (NO);
21 -    return (YES);
22 +    if (table_match(hosts_deny_table, request) == NO)
23 +       return (YES);
24 +    return (NO);
25  }
26  
27  /* table_match - match table entries with (daemon, client) pair */
28 @@ -175,8 +175,9 @@
29         (void) fclose(fp);
30      } else if (errno != ENOENT) {
31         tcpd_warn("cannot open %s: %m", table);
32 +       match = ERR;
33      }
34 -    if (match) {
35 +    if (match == YES) {
36         if (hosts_access_verbose > 1)
37             syslog(LOG_DEBUG, "matched:  %s line %d",
38                    tcpd_context.file, tcpd_context.line);
This page took 0.079188 seconds and 3 git commands to generate.