Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jan 1997 19:00:16 +0900 (JST)
From:      sanpei@yy.cs.keio.ac.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/2360: gnu-finger ports has been updated.
Message-ID:  <199701021000.TAA05247@lavender.yy.cs.keio.ac.jp>
Resent-Message-ID: <199701021010.CAA26288@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         2360
>Category:       ports
>Synopsis:       gnu-finger ports has been updated.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan  2 02:10:02 PST 1997
>Last-Modified:
>Originator:     MIHIRA Yoshiro
>Organization:
Keio Univ. Japan
>Release:        FreeBSD 2.2-961014-SNAP i386
>Environment:

FreeBSD 2.2-961014-SNAP with current bsd.port.{mk|subdir.mk}

>Description:

  Tung-Hui Hu <hhui@arcfour.com> reported GNU finger problem(ut_host
problem. see 1.)

  I fixed that and some another problems.

	n. description
		related file(s)

	1. utmp ut_host problem(from Tung-Hui Hu).
		patches/patch-ag

	2. console name problem under FreeBSD. 
		patches/patch-ah

	3. change sample start-up shell script
	   from `start.fingerd.sh.sample' to `fingerd.sh.sample'.
		Makefile
		pkg/PLIST
		pkg/DESCR

	4. add echo line to sample start-up shell script
		files/fingerd.sh.sample

Thank you.

>How-To-Repeat:

>Fix:

Apply this patch to ports tree:

diff -Nur gnu-finger.bak/Makefile gnu-finger/Makefile
--- gnu-finger.bak/Makefile	Sun Dec  1 20:13:47 1996
+++ gnu-finger/Makefile	Thu Jan  2 18:35:01 1997
@@ -21,7 +21,7 @@
 	${MKDIR} ${PREFIX}/etc/rc.d
 	@${CP} ${WRKSRC}/support/ttylocs ${PREFIX}/etc/fingerdir/ttylocs.sample
 	@${CP} ${FILESDIR}/clients.sample ${PREFIX}/etc/fingerdir/clients.sample
-	@${INSTALL} ${COPY} -m 744 -o root ${FILESDIR}/start.fingerd.sh.sample ${PREFIX}/etc/rc.d/start.fingerd.sh.sample
+	@${INSTALL} ${COPY} -m 744 -o root ${FILESDIR}/fingerd.sh.sample ${PREFIX}/etc/rc.d/fingerd.sh.sample
 	@echo "GNU.finger.server.hotname" > ${PREFIX}/etc/fingerdir/serverhost.sample
 	@echo "mail.spool.server.hostname" > ${PREFIX}/etc/fingerdir/mailhost.sample
 
diff -Nur gnu-finger.bak/files/fingerd.sh.sample gnu-finger/files/fingerd.sh.sample
--- gnu-finger.bak/files/fingerd.sh.sample	Thu Jan  1 09:00:00 1970
+++ gnu-finger/files/fingerd.sh.sample	Thu Jan  2 18:33:07 1997
@@ -0,0 +1,5 @@
+#!/bin/sh
+if [ -x /usr/local/libexec/fingerd -a -f /usr/local/etc/fingerdir/serverhost ]; then
+	/usr/local/libexec/fingerd
+	echo ' gnu-fingerd'
+fi
diff -Nur gnu-finger.bak/files/start.fingerd.sh.sample gnu-finger/files/start.fingerd.sh.sample
--- gnu-finger.bak/files/start.fingerd.sh.sample	Thu Jul 11 07:33:13 1996
+++ gnu-finger/files/start.fingerd.sh.sample	Thu Jan  1 09:00:00 1970
@@ -1,4 +0,0 @@
-#!/bin/sh
-if [ -x /usr/local/libexec/fingerd -a -f /usr/local/etc/fingerdir/serverhost ]; then
-	/usr/local/libexec/fingerd
-fi
diff -Nur gnu-finger.bak/patches/patch-ag gnu-finger/patches/patch-ag
--- gnu-finger.bak/patches/patch-ag	Thu Jan  1 09:00:00 1970
+++ gnu-finger/patches/patch-ag	Thu Jan  2 18:15:47 1997
@@ -0,0 +1,52 @@
+
+Patch for utmp ut_host.
+
+	  GNU finger uses ut_host infomation 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
diff -Nur gnu-finger.bak/patches/patch-ah gnu-finger/patches/patch-ah
--- gnu-finger.bak/patches/patch-ah	Thu Jan  1 09:00:00 1970
+++ gnu-finger/patches/patch-ah	Thu Jan  2 17:59:10 1997
@@ -0,0 +1,30 @@
+
+Patch for console name problem under FreeBSD.
+
+	  GNU finger is listed two infomation of one user for one machine,
+	(1. about login console, 2. tty which has smallest idling time.)
+	In listing algorithm, GNU finger server program [fingerd] uses
+	`console' string in tty.
+
+	  But FreeBSD is uses `ttyv[0-3]' as console name.
+
+	  So this patch is to translate `ttyv[0-3]' string to `console'
+	in GNU finger client program [in.cfingerd].
+
+--- lib/os.c.orig	Thu Jan  2 17:34:15 1997
++++ lib/os.c	Thu Jan  2 17:56:28 1997
+@@ -572,6 +572,14 @@
+ 	     finding the tty location.  `v0' is what X window terminals
+ 	     use for the console login window. */
+ 	  if ((strcmp (result[i]->ut_line, "console") == 0) ||
++#ifdef  __FreeBSD__
++	      ((strstr (result[i]->ut_line, "tty") != NULL) &&
++	      (strstr (result[i]->ut_line, "v0") != NULL) ||
++	      (strstr (result[i]->ut_line, "v0") != NULL) ||
++	      (strstr (result[i]->ut_line, "v1") != NULL) ||
++	      (strstr (result[i]->ut_line, "v2") != NULL) ||
++	      (strstr (result[i]->ut_line, "v3") != NULL)) ||
++#endif
+ 	      (strcmp (result[i]->ut_line, "v0") == 0))
+ 	    {
+ 	      console_user = result[i];
diff -Nur gnu-finger.bak/pkg/DESCR gnu-finger/pkg/DESCR
--- gnu-finger.bak/pkg/DESCR	Thu Jul 11 07:33:13 1996
+++ gnu-finger/pkg/DESCR	Thu Jan  2 18:36:05 1997
@@ -23,9 +23,8 @@
 	% kill -HUP `cat /var/run/inetd.pid`
 
 5) If this host is GNU finger server host,
-   move start.fingerd.sh.sample to start.fingerd.sh in /usr/local/etc/rc.d
-   directory.
-   And exec start_fingerd.sh.
+   rename fingerd.sh.sample to fingerd.sh in /usr/local/etc/rc.d directory.
+   And exec fingerd.sh.
 
 - Yoshiro MIHIRA
 (sanpei@yy.cs.keio.ac.jp)
diff -Nur gnu-finger.bak/pkg/PLIST gnu-finger/pkg/PLIST
--- gnu-finger.bak/pkg/PLIST	Thu Jul 11 07:33:13 1996
+++ gnu-finger/pkg/PLIST	Thu Jan  2 18:35:20 1997
@@ -2,7 +2,7 @@
 libexec/fingerd
 libexec/in.fingerd
 libexec/in.cfingerd
-etc/rc.d/start.fingerd.sh.sample
+etc/rc.d/fingerd.sh.sample
 etc/fingerdir/ttylocs.sample
 etc/fingerdir/clients.sample
 etc/fingerdir/mailhost.sample
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701021000.TAA05247>