From tony@localhost.lava.net  Sun Jul 18 01:22:54 2004
Return-Path: <tony@localhost.lava.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A669216A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 18 Jul 2004 01:22:54 +0000 (GMT)
Received: from localhost.lava.net (ampr.lava.net [64.65.96.12])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8C2AB43D46
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 18 Jul 2004 01:22:52 +0000 (GMT)
	(envelope-from tony@localhost.lava.net)
Received: from localhost.lava.net (localhost [127.0.0.1])
	by localhost.lava.net (8.12.11/8.12.11) with ESMTP id i6I1Mobt061506
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 17 Jul 2004 15:22:50 -1000 (HST)
	(envelope-from tony@localhost.lava.net)
Received: (from tony@localhost)
	by localhost.lava.net (8.12.11/8.12.11/Submit) id i6I1Mnkv061505;
	Sat, 17 Jul 2004 15:22:49 -1000 (HST)
	(envelope-from tony)
Message-Id: <200407180122.i6I1Mnkv061505@localhost.lava.net>
Date: Sat, 17 Jul 2004 15:22:49 -1000 (HST)
From: Antonio Querubin <tony@aloha.net>
Reply-To: Antonio Querubin <tony@aloha.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: update rwhoisd to version 1.5.9; install IPv6 rwhois client
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         69219
>Category:       ports
>Synopsis:       update rwhoisd to version 1.5.9; install IPv6 rwhois client
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 18 01:30:22 GMT 2004
>Closed-Date:    Fri Feb 11 17:27:38 GMT 2005
>Last-Modified:  Fri Feb 11 17:27:38 GMT 2005
>Originator:     Antonio Querubin
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD localhost 5.2-CURRENT FreeBSD 5.2-CURRENT #4: Thu Jun 17 09:19:56 HST 2004 root@localhost:/usr/obj/usr/src/sys/GENERIC i386

>Description:

	This updates the rwhoisd port to build/install version 1.5.9.  It 
	also provides an updated IPv6-capable rwhois client.

>How-To-Repeat:

>Fix:

	Below is a diff to the current port.

--- rwhois.pr begins here ---
diff -ruN rwhois.bak/Makefile rwhois/Makefile
--- rwhois.bak/Makefile	Thu Nov  6 23:28:12 2003
+++ rwhois/Makefile	Sat Jul 17 14:48:12 2004
@@ -6,22 +6,18 @@
 #
 
 PORTNAME=	rwhois
-PORTVERSION=	1.5.7.3
-PORTREVISION=	1
+PORTVERSION=	1.5.9
 CATEGORIES=	net ipv6
-MASTER_SITES=	ftp://ftp.ayamura.org/pub/rwhois/ \
+MASTER_SITES=	http://www.rwhois.net/ftp/ \
+		ftp://ftp.ayamura.org/pub/rwhois/ \
 		ftp://ftp.jp.pgpi.org/pub/rwhois/
 DISTNAME=	${PORTNAME}d-${PORTVERSION}
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	The Internic referral whois server
 
-.if !exists(/usr/include/tcpd.h)
-LIB_DEPENDS=	wrap.7:${PORTSDIR}/security/tcp_wrapper
-.endif
-
 HAS_CONFIGURE=	yes
-CONFIGURE_ARGS=	--prefix=${PREFIX}/lib/rwhois
+CONFIGURE_ARGS=	--prefix=${PREFIX}
 
 BINOWN=		bin
 BINGRP=		bin
@@ -32,6 +28,7 @@
 		operations_guide.txt rfc2167.txt security.html security.txt
 
 post-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/tools/scripts/rwhois.pl ${PREFIX}/bin/rwhois
 	${INSTALL_MAN} ${WRKSRC}/doc/rwhois_indexer.8 ${PREFIX}/man/man8
 	${INSTALL_MAN} ${WRKSRC}/doc/rwhoisd.8 ${PREFIX}/man/man8
 .if !defined(NOPORTDOCS)
@@ -41,6 +38,7 @@
 .endfor
 .endif
 	@${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/rwhoisd.sh startup file..."
-	${INSTALL_SCRIPT} -m 751 ${FILESDIR}/rwhoisd.sh ${PREFIX}/etc/rc.d/rwhoisd.sh
+	${INSTALL_SCRIPT} -m 751 ${FILESDIR}/rwhoisd.sh \
+		${PREFIX}/etc/rc.d/rwhoisd.sh
 
 .include <bsd.port.mk>
diff -ruN rwhois.bak/distinfo rwhois/distinfo
--- rwhois.bak/distinfo	Sat Jan 31 13:39:37 2004
+++ rwhois/distinfo	Sat Jul 17 14:04:09 2004
@@ -1,2 +1,2 @@
-MD5 (rwhoisd-1.5.7.3.tar.gz) = b3a1d951454afec598a7531919ce22a0
-SIZE (rwhoisd-1.5.7.3.tar.gz) = 452141
+MD5 (rwhoisd-1.5.9.tar.gz) = 27f7a174707ac10fe8648dc6322a279f
+SIZE (rwhoisd-1.5.9.tar.gz) = 521402
diff -ruN rwhois.bak/files/patch-aa rwhois/files/patch-aa
--- rwhois.bak/files/patch-aa	Tue Nov 28 05:31:15 2000
+++ rwhois/files/patch-aa	Wed Dec 31 14:00:00 1969
@@ -1,11 +0,0 @@
---- Makefile.in.orig	Tue Jun  3 23:20:53 1997
-+++ Makefile.in	Sat Nov 25 15:44:00 2000
-@@ -25,7 +25,7 @@
- BIN_SUBDIRS	= server tools
- ALL_SUBDIRS	= $(LIB_SUBDIRS) $(BIN_SUBDIRS) $(SAMPLE_DATA_DIR)
- 
--all: libraries libwrap binaries
-+all: libraries binaries
- 
- libraries:
- 	@for dir in $(LIB_SUBDIRS); do \
diff -ruN rwhois.bak/files/patch-ac rwhois/files/patch-ac
--- rwhois.bak/files/patch-ac	Tue Nov 28 05:31:16 2000
+++ rwhois/files/patch-ac	Wed Dec 31 14:00:00 1969
@@ -1,33 +0,0 @@
---- server/Makefile.in.orig	Fri May 12 01:10:25 2000
-+++ server/Makefile.in	Sat Nov 25 15:27:16 2000
-@@ -9,7 +9,7 @@
- prefix      = @prefix@
- exec_prefix = @exec_prefix@
- bindir      = $(exec_prefix)/bin
--etcdir      = $(exec_prefix)/etc
-+sbindir     = $(exec_prefix)/sbin
- 
- srcdir      = @srcdir@
- VPATH       = @srcdir@
-@@ -18,8 +18,8 @@
- COMMON_INC    = -I$(srcdir)/../common
- COMMON_LIBS   = -L../common -lrwcommon
- 
--WRAP_INC      = -I$(srcdir)../tools/tcpd_wrapper
--WRAP_LIBS     = -L../tools/tcpd_wrapper -lwrap
-+WRAP_INC      = -I${LOCALBASE}/include
-+WRAP_LIBS     = -L${LOCALBASE}/lib -lwrap
- 
- MKDB_INC      = -I$(srcdir)/../mkdb
- MKDB_LIBS     = -L../mkdb -lmkdb
-@@ -97,8 +97,8 @@
- 
- install:
- 	if [ ! -d $(exec_prefix) ]; then mkdir $(exec_prefix); fi
--	if [ ! -d $(etcdir) ]; then mkdir $(etcdir); fi
--	$(INSTALL) rwhoisd $(etcdir)
-+	if [ ! -d $(sbindir) ]; then mkdir $(sbindir); fi
-+	$(INSTALL) rwhoisd $(sbindir)
- 
- uninstall:
- 	$(RM) $(etcdir)/rwhoisd
diff -ruN rwhois.bak/files/patch-ae rwhois/files/patch-ae
--- rwhois.bak/files/patch-ae	Tue Nov 28 05:31:16 2000
+++ rwhois/files/patch-ae	Wed Dec 31 14:00:00 1969
@@ -1,11 +0,0 @@
---- sample.data/rwhoisd.conf.orig	Wed Nov 26 08:23:46 1997
-+++ sample.data/rwhoisd.conf	Sat Nov 25 15:30:05 2000
-@@ -109,7 +109,7 @@
- # users group, as found in /etc/passwd.
- # note that this really, really should be an unprivileged user
- # this options doesn't have a default.
--userid: rwhoisd
-+userid: nobody
- 
- # pid-file: where to put the file containing the pid of the server.
- # normal default is "rwhoisd.pid"
diff -ruN rwhois.bak/files/patch-common-client_msgs.c rwhois/files/patch-common-client_msgs.c
--- rwhois.bak/files/patch-common-client_msgs.c	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-common-client_msgs.c	Wed Dec 31 14:00:00 1969
@@ -1,35 +0,0 @@
---- common/client_msgs.c.orig	Tue Oct 28 02:24:02 2003
-+++ common/client_msgs.c	Tue Oct 28 02:25:00 2003
-@@ -145,22 +145,16 @@
-   printf ("%%ok\n");
- }
- 
--void print_response(va_alist)
--    va_dcl
-+void print_response(int resp_no, char *format, ...)
- {
-   va_list list;
-   int i;
--  int resp_no;
--  char *format;
-   FILE *fp;
- 
--  va_start(list);
-+  va_start(list, format);
- 
-   fp = get_out_fp();
- 
--  resp_no = va_arg(list, int);
--  format = va_arg(list, char *);
--
-   for (i = 0; i < N_RESP; i++)
-   {
-     if (resp[i].resp_no == resp_no)
-@@ -179,6 +173,7 @@
-   }
- 
-   vfprintf(fp, format, list);
-+  va_end(list);
- 
-   fprintf(fp, "\n");
- }
diff -ruN rwhois.bak/files/patch-common-client_msgs.h rwhois/files/patch-common-client_msgs.h
--- rwhois.bak/files/patch-common-client_msgs.h	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-common-client_msgs.h	Wed Dec 31 14:00:00 1969
@@ -1,11 +0,0 @@
---- common/client_msgs.h.orig	Tue Oct 28 02:25:14 2003
-+++ common/client_msgs.h	Tue Oct 28 02:25:30 2003
-@@ -85,7 +85,7 @@
- 
- void print_error PROTO((int err_no, char *str));
- 
--void print_response PROTO(());
-+void print_response PROTO((int resp_no, char *format, ...));
- 
- void print_ok PROTO((void));
- 
diff -ruN rwhois.bak/files/patch-common-common.h rwhois/files/patch-common-common.h
--- rwhois.bak/files/patch-common-common.h	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-common-common.h	Wed Dec 31 14:00:00 1969
@@ -1,11 +0,0 @@
---- common/common.h.orig	Tue Oct 28 02:23:23 2003
-+++ common/common.h	Tue Oct 28 02:23:33 2003
-@@ -56,7 +56,7 @@
- # undef _VA_ALIGN
- # undef __va_stack_arg
- # endif
--#include <varargs.h>
-+#include <stdarg.h>
- #endif /* HAVE_VPRINTF */
- 
- /* this should probably be #ifdef USG */
diff -ruN rwhois.bak/files/patch-common-log.c rwhois/files/patch-common-log.c
--- rwhois.bak/files/patch-common-log.c	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-common-log.c	Wed Dec 31 14:00:00 1969
@@ -1,38 +0,0 @@
---- common/log.c.orig	Tue Oct 28 02:26:55 2003
-+++ common/log.c	Tue Oct 28 02:28:25 2003
-@@ -139,15 +139,12 @@
- /* log_error: prints a error message to the console. This is intended
-      for server side errors only. */
- void
--log_error(va_alist)
--  va_dcl
-+log_error(char *format, ...)
- {
-   va_list   list;
--  char      *format;
-   char      err_buf[MAX_LINE];
-   
--  va_start(list);
--  format = va_arg(list, char *);
-+  va_start(list, format);
- 
- #ifdef HAVE_VSNPRINTF
-   vsnprintf(err_buf, sizeof(err_buf), format, list);
-@@ -164,15 +161,12 @@
- /* log_warning: prints a warning message to the console. This is intended
-    for server side warnings only. */
- void
--log_warning(va_alist)
--  va_dcl
-+log_warning(char *format, ...)
- {
-   va_list   list;
--  char      *format;
-   char      err_buf[MAX_LINE];
-   
--  va_start(list);
--  format = va_arg(list, char *);
-+  va_start(list, format);
- 
- #ifdef HAVE_VSNPRINTF
-   vsnprintf(err_buf, sizeof(err_buf), format, list);
diff -ruN rwhois.bak/files/patch-common-log.h rwhois/files/patch-common-log.h
--- rwhois.bak/files/patch-common-log.h	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-common-log.h	Wed Dec 31 14:00:00 1969
@@ -1,23 +0,0 @@
---- common/log.h.orig	Tue Oct 28 02:25:55 2003
-+++ common/log.h	Tue Oct 28 02:29:55 2003
-@@ -95,8 +95,8 @@
- /* old prototypes for backward compatibility */
- 
- #define l_strerror strerror
--void log_error PROTO(());
--void log_warning PROTO(());
-+void log_error PROTO((char *format, ...));
-+void log_warning PROTO((char *format, ...));
- char *get_client_hostname PROTO((int sock));
- char *timestamp PROTO(());
- 
-@@ -106,7 +106,8 @@
-      (L_LOG_EMERG, L_LOG_ALERT, etc. [see internal_log_level in
-      types.h) and SECTION is one of (NETWORK, QUERY, CONFIG, etc [see
-      log_section in types.h) */
--void log PROTO(());
-+#define log Log
-+void log PROTO((internal_log_levels level, int section, char *format, ...));
- 
- void setup_logging PROTO((void));
- 
diff -ruN rwhois.bak/files/patch-common-rw_log.c rwhois/files/patch-common-rw_log.c
--- rwhois.bak/files/patch-common-rw_log.c	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-common-rw_log.c	Wed Dec 31 14:00:00 1969
@@ -1,38 +0,0 @@
---- common/rw_log.c.orig	Tue Oct 28 02:28:43 2003
-+++ common/rw_log.c	Tue Oct 28 02:30:14 2003
-@@ -17,13 +17,10 @@
- #include "types.h"
- 
- void
--log(va_alist)
--  va_dcl
-+log(internal_log_levels level, int section, char *format, ...)
- {
-   va_list             ap;
--  internal_log_levels level;
-   FILE                *fp;
--  char                *format;
-   char                *filename;
-   char                *hostname;
-   char                message[MAX_LINE];
-@@ -31,13 +28,9 @@
-   char                *section_name;
-   int                 fd;
-   int                 use_syslog;
--  int                 section;
-   int                 syslog_level;
- 
--  va_start(ap);
--  level   = (internal_log_levels) va_arg(ap, int);
--  section = (int) va_arg(ap, int);
--  format  = va_arg(ap, char*);
-+  va_start(ap, format);
- 
-   /* verbosity sets the level at which we ignore log messages */
-   if (level > get_verbosity())
-@@ -142,4 +135,5 @@
- 
-     fclose(fp);
-   }
-+  va_end(ap);
- }
diff -ruN rwhois.bak/files/patch-rwhois.pl rwhois/files/patch-rwhois.pl
--- rwhois.bak/files/patch-rwhois.pl	Wed Dec 31 14:00:00 1969
+++ rwhois/files/patch-rwhois.pl	Sat Jul 17 14:54:39 2004
@@ -0,0 +1,231 @@
+--- tools/scripts/rwhois.pl.orig	Wed Oct 21 08:02:33 1998
++++ tools/scripts/rwhois.pl	Tue Jan 27 00:57:23 2004
+@@ -2,53 +2,136 @@
+ #
+ # rwhois - do command line rwhois queries
+ #
+-# usage:
+-#   rwhois [-h server] query[@server]
++# rwhois 1.8, 27 Jan 2004
+ #
+-# steve rader
+-# June 28th, 1998
++# ftp://ftp.lava.net/users/tony/rwhois/rwhois.pl
+ #
+-# $Id: rwhois.pl,v 1.1 1998/10/21 18:02:33 davidb Exp $
++# Maintained by Antonio Querubin.  Send bug reports and fixes to 
++# <tony@lava.net>.  (Originally written by Steve Rader.)
+ #
+ # TCP code snatched from _Programming Perl_ page 352
+ #
++# Response formats:
++#   label:value
++#   %status label:value
++#   %xfer class_name:label:value
++#
+ 
+ use Socket;
+ 
+-$default_server = "root.rwhois.net";
++# Comment the next two lines if Socket6 is not installed.
++$HAVE_SOCKET6 = 1;
++use Socket6;
++
++#$default_server = "root.rwhois.net";
++$default_server = "localhost";
+ $rwhois_port = 4321;
+ $label_width = 18;
+ 
++# Where to peek for the guardian password
++$passwd_fn = "/usr/local/etc/passwd.rwhois-guardian";
++# Max number of ID recursion levels to follow
++$recurse = 10;
++
++if ( $ARGV[0] eq "-t" ) {
++  $terse = 1;
++  shift @ARGV;
++}
+ if ( $ARGV[0] eq "-h" ) {
+   $rwhois_server = $ARGV[1];
+-  $query = "$ARGV[2]\n-quit\n";
++  shift @ARGV; shift @ARGV;
++  $query = "@ARGV";
+ } elsif ( $ARGV[0] =~ /(\S+)\@(\S+)/ ) {
+   $rwhois_server = $2;
+-  $query = "$1\n-quit\n";
++  $query = "$1";
+ } else {
+   $rwhois_server = $default_server;
+-  $query = "$ARGV[0]\n-quit\n";
++  $query = "@ARGV";
+ }
+ 
+-# who, what and where...
+-$my_addr = gethostbyname('localhost');
+-$proto = getprotobyname('tcp');
+-$port = $rwhois_port;
+-#$port = getservbyname('time', 'tcp');
+-$socket = sockaddr_in(0, $my_addr);
++# Initialize the address info list.
++if ( defined $HAVE_SOCKET6 ) {
++  @ai_list = getaddrinfo( $rwhois_server, $rwhois_port, AF_UNSPEC,
++                          SOCK_STREAM );
++  &die ( "unknown host: \"$rwhois_server\"" ) if ( scalar( @ai_list ) < 5 );
++}
++else { # Create an address info list compatible with getaddrinfo.
++  $proto = getprotobyname( 'tcp' );
++  $serv_addr = inet_aton( $rwhois_server )
++    or &die ( "unknown host: \"$rwhois_server\"" );
++  $saddr = sockaddr_in($rwhois_port, $serv_addr);
++  @ai_list = ( PF_INET, SOCK_STREAM, $proto, $saddr, undef, undef );
++}
+ 
+-# crank up the connection...
+ $| = 1;
+-$serv_addr = inet_aton($rwhois_server)
+-  or &die ("unknown host: \"$rwhois_server\"");
+-$serv_socket = sockaddr_in($port, $serv_addr);
+-socket(SOCKET, PF_INET, SOCK_STREAM, $proto)
+-  or &die ("socket create failed: \"$!\"");
+-connect(SOCKET, $serv_socket)
+-  or &die ("connect to $rwhois_server failed: \"$!\"");
++
++# get the password
++$password = "";
++open(PASSWD,$passwd_fn);
++while ( <PASSWD> ) {
++  chomp;
++  # skip comments and blank lines
++  if ( $_ !~ /^[^#]/ ) { next }
++  # find the matching server address or hostname for this query
++  if ( $_ =~ /^$rwhois_server/ ) {
++    ($junk, $password) = split /\s+/, $_;
++    last;
++  }
++}
++close(PASSWD);
++
++# initialize the idlist
++$idlist{$query} = 0;
++
++while ($recurse > -1) {
++  foreach $key (keys %idlist) {
++    if ($idlist{$key} == 0) {
++      query($key);
++      if ( $referhost[0] ne "" ) {
++        system("$0 -h $referhost[0] $key");
++      }
++      $idlist{$key} = 1;
++    }
++  }
++  $recurse--;
++}
++
++if ( $recursion == -1 )  { 
++  print "recursion limit exceed: query failed\n";
++  exit 1;
++}
++
++exit;
++
++#------------------------------------------------------------------------------
++
++sub query {
++
++local($query) = @_;
++
++# crank up the connection...
++@ai = @ai_list;
++$connect_status = 0;
++undef( $! );
++while ( scalar( @ai ) >= 5 ) {
++  ( $addrfamily, $socktype, $proto, $saddr, undef, @ai ) = @ai;
++  socket( SOCKET, $addrfamily, $socktype, $proto ) || next;
++  if ( connect( SOCKET, $saddr ) ) {
++    $connect_status = 1;
++    last;
++  }
++  close( SOCKET );
++}
++&die ( "connect to $rwhois_server port $rwhois_port failed: \"$!\"" )
++  if ! $connect_status;
++
++# send the password first if we found one
++if ($password ne "") {
++  send(SOCKET, "-security on request password $password\n", 0, $saddr);
++}
+ 
+ # send the query...
+-send(SOCKET, "$query", 0, $serv_socket)
++send(SOCKET, "$query\n", 0, $saddr)
+   or &die ("send to $rwhois_server failed: \"$!\"");
+ 
+ # ignore connect banner...
+@@ -60,6 +143,11 @@
+ $ans = 1;
+ while ( $resp = <SOCKET> ) {
+   chop $resp;
++  # remove the "%query_type" response from
++  # "-query_type something" questions...
++  if ( $query =~ /^\-(\S+)\s+/ ) {
++    $resp =~ s/\%$1\s*//;
++  }
+   # ignore cruft...
+   if (( $resp eq "" ) || ( $resp =~ /\%ok/ )) { next; }
+   # parse Class-Name and seperate
+@@ -69,21 +157,51 @@
+     if ( $ans > 1 ) { print "---\n"; }
+     $ans++;
+   }
++  # If we received a referral, parse it for the hostname and port
++  $referhost = ();
++  if ( $resp =~ /\%referral/ ) {
++    ($attribtype, $referurl) = split /\s+/, $resp;
++    $referurl =~ s/rwhois\:\/\///;
++    @referhost = split /([:,\/])/, $referurl;
++    if ($referhost[1] eq ":") {
++      $referhost[1] = $referhost[2];
++    }
++    else {
++      $referhost[1] = $rwhois_port;
++    }
++  }
+   if (( $resp =~ /\%error/ ) || ( $resp =~ /\%referral/ )) {
+     print "$resp\n";
+     next;
+   }
+   # strip off class...
+   $resp =~ s/^$class://;
+-  @F = split(/\:/, $resp);
++  @F = split(/\:/, $resp, 2);
++  # Save the IDs to query later
++  if ( $F[0] =~ s/\;I$// ) {
++    $id = $F[1];
++    $id =~ tr/A-Z/a-z/;
++    if ($idlist{$id} == undef) {
++      # 0 means we haven't queried it yet
++      $idlist{$id} = 0;
++    }
++  }
+   # un-obfuscate what rfc2167 calls ID type character...
+   if ( $F[0] =~ s/\;I$// ) { $F[0] .= "-ID"; }
+   # make the output pretty...
+-  printf "%-${label_width}.${label_width}s %s\n", "$F[0]:", $F[1];
++  if ( ! $terse ) {
++#     printf "%-${label_width}.${label_width}s %s\n", "$F[0]:", $F[1];
++     printf "%-${label_width}s %s\n", "$F[0]:", $F[1];
++  } else {
++    if (( $F[0] =~ /^IP-Network/ ) ||
++        ( $F[0] =~ /^Comments/) ) {
++#      printf "%-${label_width}.${label_width}s %s\n", "$F[0]:", $F[1];
++      printf "%-${label_width}s %s\n", "$F[0]:", $F[1];
++    }
++  }
+ }
+-
+ close(SOCKET);
+-exit;
++}
+ 
+ #------------------------------------------------------------------------------
+ 
diff -ruN rwhois.bak/files/patch-server-notify.c rwhois/files/patch-server-notify.c
--- rwhois.bak/files/patch-server-notify.c	Mon Oct 27 10:49:26 2003
+++ rwhois/files/patch-server-notify.c	Wed Dec 31 14:00:00 1969
@@ -1,31 +0,0 @@
---- server/notify.c.orig	Tue Oct 28 02:30:38 2003
-+++ server/notify.c	Tue Oct 28 02:31:26 2003
-@@ -75,18 +75,13 @@
- 
- /* log notify information */
- int
--log_entry(va_alist)
--  va_dcl
-+log_entry(char *filename, char *format, ...)
- {
-   va_list   ap;
-   FILE      *fp;
--  char      *format;
--  char      *filename;
-   char      *hostname;
- 
--  va_start(ap);
--  filename  = va_arg (ap, char*);
--  format    = va_arg(ap, char*);
-+  va_start(ap, format);
- 
-   /* lock the file */
-   fp = get_file_lock(filename, "a", 60);
-@@ -103,6 +98,7 @@
-   fprintf(fp, " [%-15s] PID: %-8d", hostname, (int) getpid());
-   vfprintf(fp, format, ap);
-   fprintf(fp, "\n");
-+  va_end(ap);
- 
-   release_file_lock(filename, fp);
- 
diff -ruN rwhois.bak/files/rwhoisd.sh rwhois/files/rwhoisd.sh
--- rwhois.bak/files/rwhoisd.sh	Tue Aug 13 14:14:07 2002
+++ rwhois/files/rwhoisd.sh	Sat Jul 17 13:49:12 2004
@@ -5,15 +5,26 @@
     exit 1
 fi
 
+CONFDIR=${PREFIX}/etc/rwhoisd
+CONF=${CONFDIR}/rwhoisd.conf
+
 case "$1" in
 start)
-	# remove or comment the following line and uncomment the one below it once you have
-	# configured your server's data
-	echo "rwhoisd not started; sample data still in place.   See ${PREFIX}/share/doc/rwhois for details."
-	#if [ -x ${PREFIX}/lib/rwhois/sbin/rwhoisd ]; then (${PREFIX}/lib/rwhois/sbin/rwhoisd -c ${PREFIX}/lib/rwhois/rwhoisd.conf &); echo -n ' rwhoisd'; fi
+	if [ -x ${PREFIX}/sbin/rwhoisd ]; then
+		if [ -x $CONF ]; then
+			${PREFIX}/sbin/rwhoisd -c ${CONF}
+			echo -n ' rwhoisd'
+		else
+			cat - << EOT >&2
+Missing configuration file $CONF.  
+See ${PREFIX}/share/doc/rwhois for details.
+EOT
+			exit 1
+		fi
+	fi
 	;;
 stop)
-	# killall rwhoisd && echo -n ' rwhoisd
+	killall rwhoisd && echo -n ' rwhoisd'
 	;;
 *)
 	echo "Usage: `basename $0` {start|stop}" >&2
diff -ruN rwhois.bak/pkg-plist rwhois/pkg-plist
--- rwhois.bak/pkg-plist	Mon Oct 27 10:49:25 2003
+++ rwhois/pkg-plist	Sat Jul 17 14:38:05 2004
@@ -1,39 +1,71 @@
+bin/rwhois
+bin/rwhois_deleter
+bin/rwhois_indexer
+bin/rwhois_repack
 etc/rc.d/rwhoisd.sh
-lib/rwhois/a.com/attribute_defs/asn.tmpl
-lib/rwhois/a.com/attribute_defs/contact.tmpl
-lib/rwhois/a.com/attribute_defs/domain.tmpl
-lib/rwhois/a.com/attribute_defs/guardian.tmpl
-lib/rwhois/a.com/attribute_defs/host.tmpl
-lib/rwhois/a.com/attribute_defs/org.tmpl
-lib/rwhois/a.com/attribute_defs/referral.tmpl
-lib/rwhois/a.com/data/asn/asn.txt
-lib/rwhois/a.com/data/contact/contact.txt
-lib/rwhois/a.com/data/domain/domain.txt
-lib/rwhois/a.com/data/guardian/guardian.txt
-lib/rwhois/a.com/data/host/host.txt
-lib/rwhois/a.com/data/org/org.txt
-lib/rwhois/a.com/data/referral/referral.txt
-lib/rwhois/a.com/schema
-lib/rwhois/a.com/soa
-lib/rwhois/bin/rwhois_deleter
-lib/rwhois/bin/rwhois_indexer
-lib/rwhois/net-10.0.0.0-8/attribute_defs/contact.tmpl
-lib/rwhois/net-10.0.0.0-8/attribute_defs/guardian.tmpl
-lib/rwhois/net-10.0.0.0-8/attribute_defs/host.tmpl
-lib/rwhois/net-10.0.0.0-8/attribute_defs/network.tmpl
-lib/rwhois/net-10.0.0.0-8/attribute_defs/referral.tmpl
-lib/rwhois/net-10.0.0.0-8/data/network/network.txt
-lib/rwhois/net-10.0.0.0-8/data/referral/referral.txt
-lib/rwhois/net-10.0.0.0-8/schema
-lib/rwhois/net-10.0.0.0-8/soa
-lib/rwhois/rwhoisd.allow
-lib/rwhois/rwhoisd.auth_area
-lib/rwhois/rwhoisd.conf
-lib/rwhois/rwhoisd.deny
-lib/rwhois/rwhoisd.dir
-lib/rwhois/rwhoisd.root
-lib/rwhois/rwhoisd.x.dir
-lib/rwhois/sbin/rwhoisd
+etc/rwhoisd/samples/a.com/attribute_defs/asn.tmpl
+etc/rwhoisd/samples/a.com/attribute_defs/contact.tmpl
+etc/rwhoisd/samples/a.com/attribute_defs/domain.tmpl
+etc/rwhoisd/samples/a.com/attribute_defs/guardian.tmpl
+etc/rwhoisd/samples/a.com/attribute_defs/host.tmpl
+etc/rwhoisd/samples/a.com/attribute_defs/org.tmpl
+etc/rwhoisd/samples/a.com/attribute_defs/referral.tmpl
+etc/rwhoisd/samples/a.com/data/asn/asn.txt
+etc/rwhoisd/samples/a.com/data/contact/contact.txt
+etc/rwhoisd/samples/a.com/data/domain/domain.txt
+etc/rwhoisd/samples/a.com/data/guardian/guardian.txt
+etc/rwhoisd/samples/a.com/data/host/host.txt
+etc/rwhoisd/samples/a.com/data/org/org.txt
+etc/rwhoisd/samples/a.com/data/referral/referral.txt
+etc/rwhoisd/samples/a.com/schema
+etc/rwhoisd/samples/a.com/soa
+etc/rwhoisd/samples/net-10.0.0.0-8/attribute_defs/contact.tmpl
+etc/rwhoisd/samples/net-10.0.0.0-8/attribute_defs/guardian.tmpl
+etc/rwhoisd/samples/net-10.0.0.0-8/attribute_defs/host.tmpl
+etc/rwhoisd/samples/net-10.0.0.0-8/attribute_defs/network.tmpl
+etc/rwhoisd/samples/net-10.0.0.0-8/attribute_defs/referral.tmpl
+etc/rwhoisd/samples/net-10.0.0.0-8/data/network/network.txt
+etc/rwhoisd/samples/net-10.0.0.0-8/data/referral/referral.txt
+etc/rwhoisd/samples/net-10.0.0.0-8/schema
+etc/rwhoisd/samples/net-10.0.0.0-8/soa
+etc/rwhoisd/samples/net-fd00:1234::-32/attribute_defs/contact.tmpl
+etc/rwhoisd/samples/net-fd00:1234::-32/attribute_defs/guardian.tmpl
+etc/rwhoisd/samples/net-fd00:1234::-32/attribute_defs/host.tmpl
+etc/rwhoisd/samples/net-fd00:1234::-32/attribute_defs/network.tmpl
+etc/rwhoisd/samples/net-fd00:1234::-32/attribute_defs/referral.tmpl
+etc/rwhoisd/samples/net-fd00:1234::-32/data/network/network.txt
+etc/rwhoisd/samples/net-fd00:1234::-32/data/referral/referral.txt
+etc/rwhoisd/samples/net-fd00:1234::-32/schema
+etc/rwhoisd/samples/net-fd00:1234::-32/soa
+etc/rwhoisd/samples/rwhoisd.allow
+etc/rwhoisd/samples/rwhoisd.auth_area
+etc/rwhoisd/samples/rwhoisd.conf
+etc/rwhoisd/samples/rwhoisd.deny
+etc/rwhoisd/samples/rwhoisd.dir
+etc/rwhoisd/samples/rwhoisd.root
+etc/rwhoisd/samples/rwhoisd.x.dir
+sbin/rwhoisd
+@dirrm etc/rwhoisd/samples/a.com/attribute_defs
+@dirrm etc/rwhoisd/samples/a.com/data/asn
+@dirrm etc/rwhoisd/samples/a.com/data/contact
+@dirrm etc/rwhoisd/samples/a.com/data/domain
+@dirrm etc/rwhoisd/samples/a.com/data/guardian
+@dirrm etc/rwhoisd/samples/a.com/data/host
+@dirrm etc/rwhoisd/samples/a.com/data/org
+@dirrm etc/rwhoisd/samples/a.com/data/referral
+@dirrm etc/rwhoisd/samples/a.com/data
+@dirrm etc/rwhoisd/samples/a.com
+@dirrm etc/rwhoisd/samples/net-10.0.0.0-8/attribute_defs
+@dirrm etc/rwhoisd/samples/net-10.0.0.0-8/data/network
+@dirrm etc/rwhoisd/samples/net-10.0.0.0-8/data/referral
+@dirrm etc/rwhoisd/samples/net-10.0.0.0-8/data
+@dirrm etc/rwhoisd/samples/net-10.0.0.0-8
+@dirrm etc/rwhoisd/samples/net-fd00:1234::-32/attribute_defs
+@dirrm etc/rwhoisd/samples/net-fd00:1234::-32/data/network
+@dirrm etc/rwhoisd/samples/net-fd00:1234::-32/data/referral
+@dirrm etc/rwhoisd/samples/net-fd00:1234::-32/data
+@dirrm etc/rwhoisd/samples/net-fd00:1234::-32
+@dirrm etc/rwhoisd/samples
 %%PORTDOCS%%%%DOCSDIR%%/INSTALL.html
 %%PORTDOCS%%%%DOCSDIR%%/TODO
 %%PORTDOCS%%%%DOCSDIR%%/UPGRADE
@@ -43,21 +75,3 @@
 %%PORTDOCS%%%%DOCSDIR%%/security.html
 %%PORTDOCS%%%%DOCSDIR%%/security.txt
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
-@dirrm lib/rwhois/sbin
-@dirrm lib/rwhois/net-10.0.0.0-8/data/referral
-@dirrm lib/rwhois/net-10.0.0.0-8/data/network
-@dirrm lib/rwhois/net-10.0.0.0-8/data
-@dirrm lib/rwhois/net-10.0.0.0-8/attribute_defs
-@dirrm lib/rwhois/net-10.0.0.0-8
-@dirrm lib/rwhois/bin
-@dirrm lib/rwhois/a.com/data/referral
-@dirrm lib/rwhois/a.com/data/org
-@dirrm lib/rwhois/a.com/data/host
-@dirrm lib/rwhois/a.com/data/guardian
-@dirrm lib/rwhois/a.com/data/domain
-@dirrm lib/rwhois/a.com/data/contact
-@dirrm lib/rwhois/a.com/data/asn
-@dirrm lib/rwhois/a.com/data
-@dirrm lib/rwhois/a.com/attribute_defs
-@dirrm lib/rwhois/a.com
-@dirrm lib/rwhois
--- rwhois.pr ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Wed Jul 28 11:33:48 GMT 2004 
State-Changed-Why:  
Is there any particular reason why you reverted to using the 
included tcp_wrappers instead of the one from base/port? -- Volker 

http://www.freebsd.org/cgi/query-pr.cgi?pr=69219 

From: "Ted Mittelstaedt" <tedm@toybox.placo.com>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc: "Volker Stolz" <vs@FreeBSD.org>
Subject: Re: ports/69219: update rwhoisd to version 1.5.9; install IPv6 rwhois client
Date: Mon, 3 Jan 2005 02:28:05 -0800

 Note on this - as far as tcpwrappers is concerned, the rwhoisd-1.5.9
 package has a configure script that doesen't check for the
 existence of tcpwrappers already being on the system, however
 the rwhoisd dameon requires the libwrap library at link time.
 
 The maintainers of the rwhois daemon package solve this by
 simply including the distribution of wrappers version
 7.6_ipv6.3 in a directory of the rwhois distribution, and
 configure makes a makefile that compiles that and creates a
 static libwrap library that is later linked into rwhoisd with
 the command:
 
 gcc  -o rwhoisd class_directive.o ... -L../tools/tcpd_wrapper -lwrap ...
 
 Doing a make install does not appear to install these wrapper
 libraries.
 
 I would support removing the tcpwrappers dependency as there
 seems no use for it.  Instead modify the rwhoisd makefile to 
 remove the -L../tools/tcpd_wrapper specifier and let it link
 in with the system libwrap.
 
 Ted
State-Changed-From-To: feedback->closed 
State-Changed-By: vs 
State-Changed-When: Fri Feb 11 17:26:40 GMT 2005 
State-Changed-Why:  
The port was update to 1.5.9 -- please check if we'd still need 
some part of your original submission. Thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=69219 
>Unformatted:
