diff options
author | max <max@FreeBSD.org> | 1997-01-06 15:32:57 +0800 |
---|---|---|
committer | max <max@FreeBSD.org> | 1997-01-06 15:32:57 +0800 |
commit | 509f9c4505870d30ad6db6c3c5fb41c68b4395a5 (patch) | |
tree | 7ea9113e4f9b7d28d3a9ee1a891ec2ce003c67ef /net | |
parent | bc08f1d89493e97694d25b56fb6785b33bca2be3 (diff) | |
download | freebsd-ports-gnome-509f9c4505870d30ad6db6c3c5fb41c68b4395a5.tar.gz freebsd-ports-gnome-509f9c4505870d30ad6db6c3c5fb41c68b4395a5.tar.zst freebsd-ports-gnome-509f9c4505870d30ad6db6c3c5fb41c68b4395a5.zip |
New patch. Description from the maintainer:
Patch for utmp ut_host.
GNU finger uses ut_host information in utmp.
From src/usr.bin/login/login.c CVS log, after 2.2 source tree,
login.c write numerical address to ut_host.
(1.12 comment of login.c)
So this patch is to translate numerical address to hostname.
Special Thanks to Tung-Hui Hu <hhui@arcfour.com>.
Submitted by: sanpei@yy.cs.keio.ac.jp
(Closing part of #PR 2360.)
Diffstat (limited to 'net')
-rw-r--r-- | net/gnu-finger/files/patch-ag | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/net/gnu-finger/files/patch-ag b/net/gnu-finger/files/patch-ag new file mode 100644 index 000000000000..173cb80eade3 --- /dev/null +++ b/net/gnu-finger/files/patch-ag @@ -0,0 +1,51 @@ +Patch for utmp ut_host. + + GNU finger uses ut_host information in utmp. + + From src/usr.bin/login/login.c CVS log, after 2.2 source tree, + login.c write numerical address to ut_host. + (1.12 comment of login.c) + + So this patch is to translate numerical address to hostname. + +Special Thanks to Tung-Hui Hu <hhui@arcfour.com>. + +--- lib/os.c.orig Mon Dec 30 00:54:57 1996 ++++ lib/os.c Mon Dec 30 10:51:30 1996 +@@ -26,6 +26,8 @@ + #include <sys/acct.h> + #include <time.h> + #include <packet.h> ++#include <sys/socket.h> ++#include <netdb.h> + + #ifdef HAVE_UTMPX_H + #include <utmpx.h> +@@ -489,6 +491,7 @@ + + UTMP **result; + int result_size = 0; ++ struct hostent *hp; u_long l; + + #ifndef HAVE_GETUTENT + file = open (UTMP_FILE, O_RDONLY); +@@ -533,6 +536,19 @@ + continue; + #endif /* sun */ + ++#ifdef __FreeBSD__ ++ if (UT(entry, ut_host)[0]) { ++ if (isdigit(UT(entry, ut_host)[0]) && ++ (long)(l = inet_addr(UT(entry, ut_host))) != -1 && ++ (hp = gethostbyaddr((char *)&l, sizeof(l), AF_INET))) { ++ if (hp->h_name) { ++ strncpy(UT(entry, ut_host), hp->h_name, UT_HOSTSIZE); ++ UT(entry, ut_host)[UT_HOSTSIZE - 1] = '\0'; ++ } /* valid hostname */ ++ } /* IP addr */ ++ } /* UTMP */ ++#endif ++ + for (i = 0; result[i]; i++) + { + /* If the same person is logged in more than once, we are |