From 7953ca3b6480f58ba22f3815334ba2092cbb81f9 Mon Sep 17 00:00:00 2001 From: wiz Date: Sat, 10 Mar 2001 17:06:37 +0000 Subject: host-991529 -- powerful replacement for host(1). Package provided by Greg A. Woods in pkg/12056, modified by me. --- net/host/Makefile | 39 +++++++++ net/host/files/md5 | 3 + net/host/files/patch-sum | 6 ++ net/host/patches/patch-aa | 31 +++++++ net/host/patches/patch-ab | 20 +++++ net/host/patches/patch-ac | 17 ++++ net/host/patches/patch-ad | 204 ++++++++++++++++++++++++++++++++++++++++++++++ net/host/pkg/DESCR | 30 +++++++ net/host/pkg/PLIST | 5 ++ 9 files changed, 355 insertions(+) create mode 100644 net/host/Makefile create mode 100644 net/host/files/md5 create mode 100644 net/host/files/patch-sum create mode 100644 net/host/patches/patch-aa create mode 100644 net/host/patches/patch-ab create mode 100644 net/host/patches/patch-ac create mode 100644 net/host/patches/patch-ad create mode 100644 net/host/pkg/DESCR create mode 100644 net/host/pkg/PLIST (limited to 'net/host') diff --git a/net/host/Makefile b/net/host/Makefile new file mode 100644 index 00000000000..a7bf351e3a5 --- /dev/null +++ b/net/host/Makefile @@ -0,0 +1,39 @@ +# $NetBSD: Makefile,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +DISTNAME= host_991529 +PKGNAME= host-991529 +CATEGORIES= net +MASTER_SITES= ftp://ftp.nikhef.nl/pub/network/ +EXTRACT_SUFX= .tar.Z + +MAINTAINER= packages@netbsd.org +HOMEPAGE= http://www.nikhef.nl/user/e07/ +COMMENT= powerful DNS query and testing tool + +.include "../../mk/bsd.prefs.mk" + +# If you've removed $HOSTALIASES support from your system then +# you won't have the hostalias() function in libc.... +.if !defined(NO_HOSTALIASES) +MAKE_ENV+= ALLOW_HOSTALIASES=-DALLOW_HOSTALIASES +.endif + +NO_CONFIGURE= yes +NO_WRKSUBDIR= yes + +# MAKE_ENV will have the right effect... +MAKEFLAGS+= -e + +post-build: + ${SED} -e 's,@PREFIX@,${PREFIX},g' ${WRKSRC}/mxlookup \ + > ${WRKDIR}/mxlookup.out + ${SED} -e 's,@PREFIX@,${PREFIX},g' ${WRKSRC}/rblookup \ + > ${WRKDIR}/rblookup.out + +do-install: + ${INSTALL_PROGRAM} ${WRKDIR}/host ${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKDIR}/mxlookup.out ${PREFIX}/bin/mxlookup + ${INSTALL_SCRIPT} ${WRKDIR}/rblookup.out ${PREFIX}/bin/rblookup + ${INSTALL_MAN} ${WRKDIR}/host.1 ${PREFIX}/man/man1/host.1 + +.include "../../mk/bsd.pkg.mk" diff --git a/net/host/files/md5 b/net/host/files/md5 new file mode 100644 index 00000000000..a986c3ac9ce --- /dev/null +++ b/net/host/files/md5 @@ -0,0 +1,3 @@ +$NetBSD: md5,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +SHA1 (host_991529.tar.Z) = 28097ee01a94bb82cec69a3be556a869ea236b5f diff --git a/net/host/files/patch-sum b/net/host/files/patch-sum new file mode 100644 index 00000000000..aa883b6e349 --- /dev/null +++ b/net/host/files/patch-sum @@ -0,0 +1,6 @@ +$NetBSD: patch-sum,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +SHA1 (patch-aa) = c81d805bd1648bf25c92687f4eecc5b514ec61ea +SHA1 (patch-ab) = 471a67439f2e5847b510f0e73bb857226c79c450 +SHA1 (patch-ac) = d7e72221a45b82c4454cb8d00aaae50a0340aad6 +SHA1 (patch-ad) = 44a38670f2557b1b7812aee98e300c760584e1a5 diff --git a/net/host/patches/patch-aa b/net/host/patches/patch-aa new file mode 100644 index 00000000000..228b632b5c2 --- /dev/null +++ b/net/host/patches/patch-aa @@ -0,0 +1,31 @@ +$NetBSD: patch-aa,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +--- Makefile.orig Wed Mar 15 22:51:39 2000 ++++ Makefile +@@ -4,11 +4,13 @@ + # Adapt the installation directories to your local standards. + # ---------------------------------------------------------------------- + ++PREFIX?= /usr/local ++ + # This is where the host executable will go. +-DESTBIN = /usr/local/bin ++DESTBIN = ${PREFIX}/bin + + # This is where the host manual page will go. +-DESTMAN = /usr/local/man ++DESTMAN = ${PREFIX}/man + + BINDIR = $(DESTBIN) + MANDIR = $(DESTMAN)/man1 +@@ -38,7 +40,10 @@ + SYSDEFS = -DNO_YP_LOOKUP + #endif + + SYSDEFS = ++ ++#if defined(NetBSD) && you have not removed support for $HOSTALIASES ++SYSDEFS = ${ALLOW_HOSTALIASES} + + # ---------------------------------------------------------------------- + # Configuration definitions. diff --git a/net/host/patches/patch-ab b/net/host/patches/patch-ab new file mode 100644 index 00000000000..93a080dd269 --- /dev/null +++ b/net/host/patches/patch-ab @@ -0,0 +1,20 @@ +$NetBSD: patch-ab,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +--- info.c.orig Mon Mar 27 12:59:11 2000 ++++ info.c +@@ -85,6 +85,7 @@ + if (*cp == '.') + dot++; + ++#ifdef ALLOW_HOSTALIASES + /* + * Check for aliases of single name. + * Note that the alias is supposed to be fully qualified. +@@ -97,6 +98,7 @@ + result = get_domaininfo(cp, (char *)NULL); + return(result); + } ++#endif + + /* + * Trailing dot means absolute (fully qualified) address. diff --git a/net/host/patches/patch-ac b/net/host/patches/patch-ac new file mode 100644 index 00000000000..3c03008e4fe --- /dev/null +++ b/net/host/patches/patch-ac @@ -0,0 +1,17 @@ +$NetBSD: patch-ac,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +--- mxlookup.orig Sun Jan 8 01:07:04 1995 ++++ mxlookup +@@ -26,10 +26,10 @@ + # Setup environment. + # ---------------------------------------------------------------------- + + # This is where the ``host'' executable lives. +-BINDIR=/usr/local/bin ++BINDIR=@PREFIX@/bin + +-PATH=${BINDIR}:/bin:/usr/bin:/usr/ucb ; export PATH ++PATH=${BINDIR}:/bin:/usr/bin ; export PATH + + cmd=`basename $0` + diff --git a/net/host/patches/patch-ad b/net/host/patches/patch-ad new file mode 100644 index 00000000000..15cc52dbbc9 --- /dev/null +++ b/net/host/patches/patch-ad @@ -0,0 +1,204 @@ +$NetBSD: patch-ad,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ + +--- rblookup.orig Wed Jan 27 01:50:22 1999 ++++ rblookup +@@ -12,8 +12,8 @@ + # of the Mail Abuse Prevention System. See: http://maps.vix.com/rbl + # + # Syntax: +-# rblookup hostname +-# rblookup -i dottedquad ++# rblookup hostname ... ++# rblookup -i dottedquad ... + # + # Returns: + # zero if the given host was found on the blacklist. +@@ -44,25 +44,72 @@ + # Setup environment. + # ---------------------------------------------------------------------- + + # This is where the ``host'' executable lives. +-BINDIR=/usr/local/bin ++BINDIR=@PREFIX@/bin + +-PATH=${BINDIR}:/bin:/usr/bin:/usr/ucb ; export PATH ++PATH=${BINDIR}:/bin:/usr/bin ; export PATH + + cmd=`basename $0` + +-options="[-maps] [-orbs] [-i] [-v]" +-usage="Usage: $cmd $options hostname" ++options="[-dul] [-maps] [-orbs] [-relays] [-i] [-v]" ++usage="Usage: $cmd $options hostname|IP# ..." + + # ---------------------------------------------------------------------- +-# Configuration. ++# RBLs: + # ---------------------------------------------------------------------- + +-MAPSROOT="rbl.maps.vix.com" ++# MAPS RBL: Mail Abuse Protection System Realtime Blackhole List ++# ++# ++# This listing is human-operated, and is one of the most popular ++# blacklists of spam-originating systems. Originally started by Paul ++# Vixie, this is the original "RBL" system. ++# ++MAPSROOT="blackholes.mail-abuse.org" ++ALLRBLS="${MAPSROOT} ${ALLRBLS}" ++ ++# MAPS DUL: Mail Abuse Protection System Dial-up User List ++# ++# ++# This list was started from a list compiled by "Afterburner" (the ++# head-honcho abuse guy at Erols Internet), and extended to be easily ++# added to over time. This service was originally called the ORCA ++# DUL, and was operated at "dul.orca.bc.ca". The MAPS project invited ++# Al Iverson, the then-current DUL maintainer, to host it on their ++# systems. ++# ++DULROOT="dialups.mail-abuse.org" ++ALLRBLS="${DULROOT} ${ALLRBLS}" ++ ++# ORBS: Open Relay Behaviour-modification System ++# ++# ++# This is an listing of IP addresses that have been submitted by spam ++# victims and others and have been automatically tested and proven to ++# be the output ports of SMTP servers that will transmit at least one ++# message to any system for anyone (an "open email relay"). ++# Administrators of listed servers can request re-testing and ++# automated systems will remove those that have proven to close their ++# relays. Input points of multi-level relays can be submitted too, ++# but only the output point is listed in the DNS RBL. ++# + ORBSROOT="relays.orbs.org" ++ALLRBLS="${ORBSROOT} ${ALLRBLS}" ++ ++# RSS: MAPS Relay Spam Stopper ++# ++# ++# This is a list of e-mail relays which have been verified to have ++# been used to send spam. They supposedly have archives of the spam ++# they received through these relays. They do not list multi-level ++# relays (and thus miss a vast number of the actively exploited ++# systems out there -- I really hope they change this policy)! ++# ++RELAYSROOT="relays.mail-abuse.org" ++ALLRBLS="${RELAYSROOT} ${ALLRBLS}" + + # ---------------------------------------------------------------------- +-# Exit codes from ++# Exit codes from , just in case we are called from a mailer + # ---------------------------------------------------------------------- + + EX_OK=0 +@@ -85,8 +134,11 @@ + # ---------------------------------------------------------------------- + + verbose= +-reverse= +-orbs= ++reverse=false ++orbs=false ++dul=false ++maps=false ++relays=false + + skip= + for i +@@ -95,7 +147,9 @@ + + case "$i" in + -orbs) orbs=true ;; +- -maps) orbs= ;; ++ -dul) dul=true ;; ++ -maps) maps=true ;; ++ -relays) relays=true ;; + -i) reverse=true ;; + -v) verbose="-v" ;; + -d) exec=echo ;; +@@ -105,28 +159,10 @@ + shift + done + +-# ---------------------------------------------------------------------- +-# Process arguments. +-# ---------------------------------------------------------------------- +- +-name="$1" +- +-[ "X$name" = "X" ] && fatal "$usage" +- +-# Remove trailing dots. +-name=`echo $name | sed 's/\.*$//'` +- +-if [ $reverse ] +-then +- # Assume this is already a dotted quad. +- addresslist="$name" +-else +- # Try to resolve domain name into dotted quad. +- addresslist=`host "$name" | awk '$2 == "A" {print $3}'` +-fi ++[ $# -lt 1 ] && fatal "$usage" + + # ---------------------------------------------------------------------- +-# Auxiliary routines. ++# More routines. + # ---------------------------------------------------------------------- + + invalid () +@@ -180,20 +216,42 @@ + + exitstat=$EX_UNAVAILABLE + +-for address in $addresslist ++for name in ${1+$@} + do ++ # Remove trailing dots. ++ name=`echo $name | sed 's/\.*$//'` ++ ++ if $reverse ++ then ++ # Assume this is already a dotted quad. ++ address="$name" ++ else ++ # Try to resolve domain name into dotted quad. ++ address=`host "$name" | awk '$2 == "A" {print $3}'` ++ fi ++ + # Swap dotted quad labels. + invert + +- # Construct proper name in map. +- [ $orbs ] && map="$ORBSROOT" || map="$MAPSROOT" +- name="$reversed.$map" +- +- echo "--- $name ---" +- $exec host $verbose -t A $name +- found=$? +- [ $found -eq $EX_OK ] && exitstat=$EX_OK +- [ $found -eq $EX_OK ] && $exec host $verbose -t TXT $name ++ rbllist="" ++ $orbs && rbllist="$ORBSROOT $rbllist" ++ $dul && rbllist="$DULROOT $rbllist" ++ $maps && rbllist="$MAPSROOT $rbllist" ++ $relays && rbllist="$RELAYSROOT $rbllist" ++ ++ [ -z "$rbllist" ] && rbllist="$ALLRBLS" ++ ++ for rbl in $rbllist ++ do ++ # Construct proper name in map. ++ name="$reversed.$rbl" ++ ++ echo "--- $name ---" ++ $exec host $verbose -t A $name ++ found=$? ++ [ $found -eq $EX_OK ] && exitstat=$EX_OK ++ [ $found -eq $EX_OK ] && $exec host $verbose -t TXT $name ++ done + done + + exit $exitstat diff --git a/net/host/pkg/DESCR b/net/host/pkg/DESCR new file mode 100644 index 00000000000..9ed70bd6c5f --- /dev/null +++ b/net/host/pkg/DESCR @@ -0,0 +1,30 @@ +Host is a very powerful DNS query and testing command-line tool. + +Major differences with the ancient version of the program with the same +name that's included in the BIND-4 and BIND-8 distributions: + + - Major overhaul of the entire code. + - Very rigid error checking, with more verbose error messages. + - Zone listing section completely rewritten. + - It is now possible to do recursive listings into delegated zones. + - Maintain resource record statistics during zone listings. + - Maintain count of hosts during zone listings. + - Check for various extraneous conditions during zone listings. + - Check for illegal domain names containing invalid characters. + - Verify that certain domain names represent canonical host names. + - Perform ttl consistency checking during zone listings. + - Exploit multiple server addresses if available. + - Option to exploit only primary server for zone transfers. + - Option to exclude info from names that do not reside in a zone. + - Implement timeout handling during connect and read. + - Write resource record output to optional log file. + - Special MB tracing by recursively expanding MR and MG records. + - Special mode to check SOA records at each nameserver for a zone. + - Special mode to check reverse mappings of host addresses. + - Extended syntax allows multiple arguments on command line or stdin. + - Configurable default options in HOST_DEFAULTS environment variable. + - Implement new resource record types from RFC 1183 and 1348. + - Basic experimental NSAP support as defined in RFC 1637. + - Implement new resource record types from RFC 1664 and 1712. + - Implement new resource record types from RFC 1876 and 1886. + - Code is extensively documented. diff --git a/net/host/pkg/PLIST b/net/host/pkg/PLIST new file mode 100644 index 00000000000..771c411beac --- /dev/null +++ b/net/host/pkg/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2001/03/10 17:06:37 wiz Exp $ +bin/host +bin/mxlookup +bin/rblookup +man/man1/host.1 -- cgit v1.2.3