CVS commit: src/usr.bin/whois

2009-04-14 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue Apr 14 08:00:48 UTC 2009

Modified Files:
src/usr.bin/whois: whois.c

Log Message:
fix -Wcast-qual issues


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/whois/whois.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/whois.c
diff -u src/usr.bin/whois/whois.c:1.33 src/usr.bin/whois/whois.c:1.34
--- src/usr.bin/whois/whois.c:1.33	Mon Jul 21 14:19:28 2008
+++ src/usr.bin/whois/whois.c	Tue Apr 14 08:00:48 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: whois.c,v 1.33 2008/07/21 14:19:28 lukem Exp $   */
+/*  $NetBSD: whois.c,v 1.34 2009/04/14 08:00:48 lukem Exp $   */
 /*	$OpenBSD: whois.c,v 1.28 2003/09/18 22:16:15 fgsch Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
 #if 0
 static const char sccsid[] = "@(#)whois.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: whois.c,v 1.33 2008/07/21 14:19:28 lukem Exp $");
+__RCSID("$NetBSD: whois.c,v 1.34 2009/04/14 08:00:48 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -88,13 +88,13 @@
 
 static void usage(void) __dead;
 static int whois(const char *, const char *, const char *, int);
-static char *choose_server(const char *, const char *);
+static const char *choose_server(const char *, const char *);
 
 int
 main(int argc, char *argv[])
 {
 	int ch, flags, rval;
-	char *host, *name, *country;
+	const char *host, *name, *country;
 
 #ifdef SOCKS
 	SOCKSinit(argv[0]);
@@ -288,7 +288,7 @@
  * (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+).
  * Fall back to NICHOST for the non-handle case.
  */
-static char *
+static const char *
 choose_server(const char *name, const char *country)
 {
 	static char *server;



CVS commit: src/usr.bin/whois

2009-05-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon May  4 21:13:58 UTC 2009

Modified Files:
src/usr.bin/whois: whois.1

Log Message:
Punctuation.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/whois/whois.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/whois.1
diff -u src/usr.bin/whois/whois.1:1.24 src/usr.bin/whois/whois.1:1.25
--- src/usr.bin/whois/whois.1:1.24	Sun Sep  9 18:31:45 2007
+++ src/usr.bin/whois/whois.1	Mon May  4 21:13:58 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: whois.1,v 1.24 2007/09/09 18:31:45 christos Exp $
+.\" $NetBSD: whois.1,v 1.25 2009/05/04 21:13:58 wiz Exp $
 .\"	$OpenBSD: whois.1,v 1.22 2003/09/02 18:50:07 jmc Exp $
 .\"
 .\" Copyright (c) 1985, 1990, 1993
@@ -70,8 +70,8 @@
 database.
 It contains network numbers used in those parts of the world
 not covered by
-.Tn AfriNIC,
-.Tn APNIC,
+.Tn AfriNIC ,
+.Tn APNIC ,
 .Tn LACNIC
 or by
 .Tn RIPE .
@@ -93,7 +93,7 @@
 Use the African Network Information Center
 .Pq Tn AfriNIC
 database.
-It contains network numbers used in Africa
+It contains network numbers used in Africa.
 .It Fl g
 Use the US non-military federal government database, which contains points of
 contact for subdomains of



CVS commit: src/usr.bin/whois

2011-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 17 13:57:12 UTC 2011

Modified Files:
src/usr.bin/whois: whois.c

Log Message:
fix non-literal string format


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/whois/whois.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/whois.c
diff -u src/usr.bin/whois/whois.c:1.34 src/usr.bin/whois/whois.c:1.35
--- src/usr.bin/whois/whois.c:1.34	Tue Apr 14 04:00:48 2009
+++ src/usr.bin/whois/whois.c	Wed Aug 17 09:57:12 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: whois.c,v 1.34 2009/04/14 08:00:48 lukem Exp $   */
+/*  $NetBSD: whois.c,v 1.35 2011/08/17 13:57:12 christos Exp $   */
 /*	$OpenBSD: whois.c,v 1.28 2003/09/18 22:16:15 fgsch Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
 #if 0
 static const char sccsid[] = "@(#)whois.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: whois.c,v 1.34 2009/04/14 08:00:48 lukem Exp $");
+__RCSID("$NetBSD: whois.c,v 1.35 2011/08/17 13:57:12 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -216,15 +216,15 @@
 
 	if (strcmp(server, "whois.denic.de") == 0 ||
 	strcmp(server, "de.whois-servers.net") == 0)
-		fmt = "-T dn,ace -C ISO-8859-1 %s\r\n";
+		fmt = "-T dn,ace -C ISO-8859-1";
 	else
-		fmt = "%s\r\n";
+		fmt = "";
 
 	sfi = fdopen(s, "r");
 	sfo = fdopen(s, "w");
 	if (sfi == NULL || sfo == NULL)
 		err(1, "fdopen");
-	(void)fprintf(sfo, fmt, query);
+	(void)fprintf(sfo, "%s%s\r\n", fmt, query);
 	(void)fflush(sfo);
 	nhost = NULL;
 	while ((buf = fgetln(sfi, &len)) != NULL) {



CVS commit: src/usr.bin/whois

2013-02-20 Thread Wolfgang Solfrank
Module Name:src
Committed By:   ws
Date:   Wed Feb 20 09:27:52 UTC 2013

Modified Files:
src/usr.bin/whois: whois.c

Log Message:
It helps to separate arguments from the query.
While still suboptimal (you cannot use all the queries specified for .DE),
at least this way we don't get cryptic error messages for standard queries.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/whois/whois.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/whois.c
diff -u src/usr.bin/whois/whois.c:1.35 src/usr.bin/whois/whois.c:1.36
--- src/usr.bin/whois/whois.c:1.35	Wed Aug 17 13:57:12 2011
+++ src/usr.bin/whois/whois.c	Wed Feb 20 09:27:52 2013
@@ -1,4 +1,4 @@
-/*  $NetBSD: whois.c,v 1.35 2011/08/17 13:57:12 christos Exp $   */
+/*  $NetBSD: whois.c,v 1.36 2013/02/20 09:27:52 ws Exp $   */
 /*	$OpenBSD: whois.c,v 1.28 2003/09/18 22:16:15 fgsch Exp $	*/
 
 /*
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static const char sccsid[] = "@(#)whois.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: whois.c,v 1.35 2011/08/17 13:57:12 christos Exp $");
+__RCSID("$NetBSD: whois.c,v 1.36 2013/02/20 09:27:52 ws Exp $");
 #endif
 #endif /* not lint */
 
@@ -216,7 +216,7 @@ whois(const char *query, const char *ser
 
 	if (strcmp(server, "whois.denic.de") == 0 ||
 	strcmp(server, "de.whois-servers.net") == 0)
-		fmt = "-T dn,ace -C ISO-8859-1";
+		fmt = "-T dn,ace -C ISO-8859-1 ";
 	else
 		fmt = "";
 



CVS commit: src/usr.bin/whois

2020-02-29 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Mar  1 02:19:43 UTC 2020

Modified Files:
src/usr.bin/whois: whois.1 whois.c

Log Message:
Merge in changes from OpenBSD 6.6 whois(1).
This improves recursion support and querying whois servers.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/whois/whois.1
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/whois/whois.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/whois.1
diff -u src/usr.bin/whois/whois.1:1.26 src/usr.bin/whois/whois.1:1.27
--- src/usr.bin/whois/whois.1:1.26	Thu Mar 15 22:35:03 2012
+++ src/usr.bin/whois/whois.1	Sun Mar  1 02:19:43 2020
@@ -1,8 +1,8 @@
-.\" $NetBSD: whois.1,v 1.26 2012/03/15 22:35:03 njoly Exp $
-.\"	$OpenBSD: whois.1,v 1.22 2003/09/02 18:50:07 jmc Exp $
+.\" $NetBSD: whois.1,v 1.27 2020/03/01 02:19:43 sevan Exp $
+.\" $OpenBSD: whois.1,v 1.36 2016/02/20 20:52:50 naddy Exp $
 .\"
 .\" Copyright (c) 1985, 1990, 1993
-.\"	The Regents of the University of California.  All rights reserved.
+.\"The Regents of the University of California.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
 .\"
 .\" @(#)whois.1	8.2 (Berkeley) 6/20/94
 .\"
-.Dd September 9, 2007
+.Dd March 1, 2020
 .Dt WHOIS 1
 .Os
 .Sh NAME
@@ -38,12 +38,12 @@
 .Nd Internet domain name and network number directory service
 .Sh SYNOPSIS
 .Nm whois
-.Op Fl 6AadfgilmQRr
+.Op Fl AadfgIilmPQRr
 .Oo
 .Fl c Ar country-code | Fl h Ar host
 .Oc
 .Op Fl p Ar port
-.Ar name Op Ar ...
+.Ar name ...
 .Sh DESCRIPTION
 The
 .Nm
@@ -53,11 +53,6 @@ Network Information Centers
 .Pp
 The options are as follows:
 .Bl -tag -width Ds
-.It Fl 6
-Use the IPv6 Resource Center
-.Pq Tn 6bone
-database.
-It contains network names and addresses for the IPv6 network.
 .It Fl A
 Use the Asia/Pacific Network Information Center
 .Pq Tn APNIC
@@ -69,11 +64,11 @@ Use the American Registry for Internet N
 .Pq Tn ARIN
 database.
 It contains network numbers used in those parts of the world
-not covered by
+covered neither by
 .Tn AfriNIC ,
 .Tn APNIC ,
-.Tn LACNIC
-or by
+.Tn LACNIC ,
+nor by
 .Tn RIPE .
 .Pp
 (Hint: All point of contact handles in the
@@ -107,8 +102,11 @@ By default
 .Nm
 constructs the name of a whois server to use from the top-level domain
 .Pq Tn TLD
-of the supplied (single) argument, and appending
-.Qq Li .whois-servers.net .
+of the supplied (single) argument.
+For newer generic domains (gTLDs), a lookup for whois.nic.tld is attempted.
+For other TLDs, or if this lookup fails,
+.Qq Li .whois-servers.net
+is appended to the TLD.
 This effectively allows a suitable whois server to be selected
 automatically for a large number of
 .Tn TLDs .
@@ -131,6 +129,11 @@ If the query is not a domain name or IP 
 .Nm
 will fall back to
 .Pa whois.crsnic.net .
+.It Fl I
+Use the Internet Assigned Numbers Authority
+.Pq whois.iana.org
+root zone database.
+It contains information about top-level domains.
 .It Fl i
 Use the Network Solutions Registry for Internet Numbers
 .Pq Tn whois.networksolutions.com
@@ -175,6 +178,10 @@ Use the Route Arbiter Database
 database.
 It contains route policy specifications for a large
 number of operators' networks.
+.It Fl P
+Use the PeeringDB database of AS numbers.
+It contains details about presence at internet peering points
+for many network operators.
 .It Fl p Ar port
 Connect to the whois server on
 .Ar port .
@@ -277,15 +284,6 @@ but other
 .Tn TLDs
 can be queried by using a similar syntax.)
 .Pp
-The following example demonstrates how to obtain information about an
-.Tn IPv6
-address or hostname using the
-.Fl 6
-option, which directs the query to
-.Tn 6bone .
-.Pp
-.Dl "whois -6 IPv6-IP-Address"
-.Pp
 The following example demonstrates how to query
 a whois server using a non-standard port, where
 .Dq Li query-data
@@ -296,13 +294,21 @@ on port
 (written numerically as 4321).
 .Pp
 .Dl "whois -h whois.example.com -p rwhois query-data"
-.Sh SEE ALSO
+.Sh STANDARDS
 .Rs
-.%A Ken Harrenstien
-.%A Vic White
+.%A K. Harrenstien
+.%A M. Stahl
+.%A E. Feinler
+.%D October 1985
+.%R RFC 954
 .%T NICNAME/WHOIS
-.%D 1 March 1982
-.%O RFC 812
+.Re
+.Pp
+.Rs
+.%A L. Daigle
+.%D September 2004
+.%R RFC 3912
+.%T WHOIS Protocol Specification
 .Re
 .Sh HISTORY
 The

Index: src/usr.bin/whois/whois.c
diff -u src/usr.bin/whois/whois.c:1.36 src/usr.bin/whois/whois.c:1.37
--- src/usr.bin/whois/whois.c:1.36	Wed Feb 20 09:27:52 2013
+++ src/usr.bin/whois/whois.c	Sun Mar  1 02:19:43 2020
@@ -1,5 +1,5 @@
-/*  $NetBSD: whois.c,v 1.36 2013/02/20 09:27:52 ws Exp $   */
-/*	$OpenBSD: whois.c,v 1.28 2003/09/18 22:16:15 fgsch Exp $	*/
+/*  $NetBSD: whois.c,v 1.37 2020/03/01 02:19:43 sevan Exp $*/
+/*  $OpenBSD: whois.c,v 1.58 2018/06/19 11:28:11 jca Exp $   */

CVS commit: src/usr.bin/whois

2020-02-29 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Mar  1 02:26:16 UTC 2020

Modified Files:
src/usr.bin/whois: whois.c

Log Message:
Order caps first


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/whois/whois.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/whois.c
diff -u src/usr.bin/whois/whois.c:1.37 src/usr.bin/whois/whois.c:1.38
--- src/usr.bin/whois/whois.c:1.37	Sun Mar  1 02:19:43 2020
+++ src/usr.bin/whois/whois.c	Sun Mar  1 02:26:16 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: whois.c,v 1.37 2020/03/01 02:19:43 sevan Exp $*/
+/*  $NetBSD: whois.c,v 1.38 2020/03/01 02:26:16 sevan Exp $*/
 /*  $OpenBSD: whois.c,v 1.58 2018/06/19 11:28:11 jca Exp $   */
 
 /*
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static const char sccsid[] = "@(#)whois.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: whois.c,v 1.37 2020/03/01 02:19:43 sevan Exp $");
+__RCSID("$NetBSD: whois.c,v 1.38 2020/03/01 02:26:16 sevan Exp $");
 #endif
 #endif /* not lint */
 
@@ -99,7 +99,7 @@ main(int argc, char *argv[])
 
 	country = host = NULL;
 	flags = rval = 0;
-	while ((ch = getopt(argc, argv, "aAc:dfgh:Iilmp:PqQRr")) != -1)
+	while ((ch = getopt(argc, argv, "Aac:dfgh:Iilmp:PqQRr")) != -1)
 		switch (ch) {
 		case 'a':
 			host = ANICHOST;



CVS commit: src/usr.bin/whois

2020-02-29 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Mar  1 02:45:04 UTC 2020

Modified Files:
src/usr.bin/whois: Makefile

Log Message:
RIPE definition no longer exists in source


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/whois/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/whois/Makefile
diff -u src/usr.bin/whois/Makefile:1.7 src/usr.bin/whois/Makefile:1.8
--- src/usr.bin/whois/Makefile:1.7	Tue Apr 14 22:15:29 2009
+++ src/usr.bin/whois/Makefile	Sun Mar  1 02:45:04 2020
@@ -1,9 +1,8 @@
-#	$NetBSD: Makefile,v 1.7 2009/04/14 22:15:29 lukem Exp $
+#	$NetBSD: Makefile,v 1.8 2020/03/01 02:45:04 sevan Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 USE_FORT?= yes	# network client
 
 PROG=		whois
-CPPFLAGS+=	-DRIPE
 
 .include