summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch')
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
new file mode 100644
index 0000000000..725f4b5957
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
@@ -0,0 +1,32 @@
1Upstream-Status: Backport
2
3* Mon Feb 5 2001 Preston Brown <pbrown@redhat.com>
4- fix gethostbyname to work better with dot "." notation (#16949)
5
6--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
7+++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
8@@ -52,7 +52,8 @@
9 char *name;
10 {
11 char dot_name[MAXHOSTNAMELEN + 1];
12-
13+ struct hostent *hp;
14+
15 /*
16 * Don't append dots to unqualified names. Such names are likely to come
17 * from local hosts files or from NIS.
18@@ -61,8 +62,12 @@
19 if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
20 return (gethostbyname(name));
21 } else {
22- sprintf(dot_name, "%s.", name);
23- return (gethostbyname(dot_name));
24+ sprintf(dot_name, "%s.", name);
25+ hp = gethostbyname(dot_name);
26+ if (hp)
27+ return hp;
28+ else
29+ return (gethostbyname(name));
30 }
31 }
32