]> git.pld-linux.org Git - packages/tcp_wrappers.git/blame - tcp_wrappers-fixgethostbyname.patch
- rediffed
[packages/tcp_wrappers.git] / tcp_wrappers-fixgethostbyname.patch
CommitLineData
7bafbb87 1--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
2+++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
3@@ -52,7 +52,8 @@
4 char *name;
5 {
6 char dot_name[MAXHOSTNAMELEN + 1];
7-
8+ struct hostent *hp;
9+
10 /*
11 * Don't append dots to unqualified names. Such names are likely to come
12 * from local hosts files or from NIS.
13@@ -61,8 +62,12 @@
14 if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
15 return (gethostbyname(name));
16 } else {
17- sprintf(dot_name, "%s.", name);
18- return (gethostbyname(dot_name));
19+ sprintf(dot_name, "%s.", name);
20+ hp = gethostbyname(dot_name);
21+ if (hp)
22+ return hp;
23+ else
24+ return (gethostbyname(name));
25 }
26 }
27
This page took 0.129305 seconds and 4 git commands to generate.