Imported Debian version 5.0.2

This commit is contained in:
Marco d'Itri 2010-04-11 04:17:33 +02:00
parent 9627a203ce
commit 00a8697ca9
7 changed files with 154 additions and 97 deletions

View File

@ -1,5 +1,5 @@
/* Program version */ /* Program version */
#define VERSION "5.0.1" #define VERSION "5.0.2"
/* Configurable features */ /* Configurable features */
@ -37,6 +37,7 @@
#endif #endif
#if defined __APPLE__ && defined __MACH__ #if defined __APPLE__ && defined __MACH__
# define HAVE_GETOPT_LONG
# define HAVE_GETADDRINFO # define HAVE_GETADDRINFO
#endif #endif
@ -57,6 +58,7 @@
/* FIXME: which systems lack this? */ /* FIXME: which systems lack this? */
#define HAVE_GETTIMEOFDAY #define HAVE_GETTIMEOFDAY
#define HAVE_INET_PTON
/* /*
* Please send patches to correctly ignore old releases which lack a RNG * Please send patches to correctly ignore old releases which lack a RNG

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
whois (5.0.2) unstable; urgency=medium
* Added new IPv4 allocations.
* Updated one or more translations. (Closes: #572068)
* Updated the .gt TLD server. (Closes: #576521)
* Use inet_pton (if available) to parse IP addresses. (Closes: #573006)
-- Marco d'Itri <md@linux.it> Sun, 11 Apr 2010 04:17:33 +0200
whois (5.0.1) unstable; urgency=medium whois (5.0.1) unstable; urgency=medium
* Added new IPv4 allocations. * Added new IPv4 allocations.

View File

@ -8,6 +8,7 @@
# #
1.0.0.0/8 apnic 1.0.0.0/8 apnic
2.0.0.0/8 ripe 2.0.0.0/8 ripe
14.0.0.0/8 apnic
24.132.0.0/14 ripe 24.132.0.0/14 ripe
27.0.0.0/8 apnic 27.0.0.0/8 apnic
41.0.0.0/8 afrinic 41.0.0.0/8 afrinic
@ -29,14 +30,16 @@
78.0.0.0/7 ripe 78.0.0.0/7 ripe
80.0.0.0/4 ripe # => 95.255.255.255 80.0.0.0/4 ripe # => 95.255.255.255
96.0.0.0/6 arin # => 99.255.255.255 96.0.0.0/6 arin # => 99.255.255.255
107.0.0.0/8 arin
108.0.0.0/8 arin 108.0.0.0/8 arin
109.0.0.0/8 ripe 109.0.0.0/8 ripe
110.0.0.0/7 apnic 110.0.0.0/7 apnic
96.0.0.0/4 UNALLOCATED # => 112.215.255.255 96.0.0.0/4 UNALLOCATED # => 112.215.255.255
118.32.0.0/11 whois.nic.or.kr 112.160.0.0/11 whois.nic.or.kr
119.192.0.0/11 whois.nic.or.kr
115.0.0.0/12 whois.nic.or.kr 115.0.0.0/12 whois.nic.or.kr
115.16.0.0/13 whois.nic.or.kr 115.16.0.0/13 whois.nic.or.kr
118.32.0.0/11 whois.nic.or.kr
119.192.0.0/11 whois.nic.or.kr
112.0.0.0/5 apnic 112.0.0.0/5 apnic
121.128.0.0/10 whois.nic.or.kr 121.128.0.0/10 whois.nic.or.kr
125.128.0.0/11 whois.nic.or.kr 125.128.0.0/11 whois.nic.or.kr
@ -100,9 +103,11 @@
171.16.0.0/12 ripe 171.16.0.0/12 ripe
171.32.0.0/15 ripe 171.32.0.0/15 ripe
#171.0.0.0/8 apnic #171.0.0.0/8 apnic
175.192.0.0/10 whois.nic.or.kr
175.0.0.0/8 apnic 175.0.0.0/8 apnic
178.0.0.0/8 ripe 178.0.0.0/8 ripe
180.0.0.0/8 apnic 180.0.0.0/8 apnic
183.96.0.0/11 whois.nic.or.kr
182.0.0.0/7 apnic 182.0.0.0/7 apnic
186.0.0.0/7 lacnic 186.0.0.0/7 lacnic
188.0.0.0/8 ripe # transferred from ARIN to to RIPE 188.0.0.0/8 ripe # transferred from ARIN to to RIPE
@ -232,6 +237,5 @@
222.120.0.0/15 whois.nic.or.kr 222.120.0.0/15 whois.nic.or.kr
222.122.0.0/16 whois.nic.or.kr 222.122.0.0/16 whois.nic.or.kr
222.232.0.0/13 whois.nic.or.kr 222.232.0.0/13 whois.nic.or.kr
223.0.0.0/8 UNALLOCATED # returned from APNIC to IANA
220.0.0.0/6 apnic 220.0.0.0/6 apnic
# that's all... here starts the multicast space # that's all... here starts the multicast space

185
po/de.po
View File

@ -1,18 +1,18 @@
# Abgeleitet von whois.pot. # Translation of whois to German
# Copyright (C) 2001 Simon Richter <Simon.Richter@in.tum.de> # Copyright (C) 2001 Simon Richter <Simon.Richter@in.tum.de>, 2004 Adrian
# Copyright (C) 2004 Adrian Bunk <bunk@fs.tum.de> # Bunk <bunk@fs.tum.de>, 2010 Chris Leick <c.leick@vollbio.de>.
# # This file is distributed under the same license as the whois package.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: whois 4.6.16\n" "Project-Id-Version: whois 5.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: Marco d'Itri <md@linux.it>\n"
"POT-Creation-Date: 2010-01-27 13:38+0100\n" "POT-Creation-Date: 2010-01-27 13:38+0100\n"
"PO-Revision-Date: 2004-06-15 00:08+0100\n" "PO-Revision-Date: 2010-02-28 11:16+GMT\n"
"Last-Translator: Adrian Bunk <bunk@fs.tum.de>\n" "Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
"Language-Team: \n" "Language-Team: German <debian-l10n-german@lists.debian.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
@ -25,29 +25,32 @@ msgid ""
msgstr "" msgstr ""
"Version %s.\n" "Version %s.\n"
"\n" "\n"
"Senden Sie Bugreports an %s.\n" "Berichten Sie Fehler auf Englisch an %s.\n"
#: ../whois.c:190 ../whois.c:243 ../whois.c:249 ../whois.c:256 ../whois.c:286 #: ../whois.c:190 ../whois.c:243 ../whois.c:249 ../whois.c:256 ../whois.c:286
#, c-format #, c-format
msgid "Using server %s.\n" msgid "Using server %s.\n"
msgstr "Benutze Server %s.\n" msgstr "Server %s wird benutzt.\n"
#: ../whois.c:228 #: ../whois.c:228
msgid "This TLD has no whois server, but you can access the whois database at" msgid "This TLD has no whois server, but you can access the whois database at"
msgstr "Diese TLD hat keinen whois-Server, aber eine whois-Datenbank unter" msgstr ""
"Diese TLD hat keinen Whois-Server, kann aber auf eine Whois-Datenbank "
"zugreifen unter"
#: ../whois.c:233 #: ../whois.c:233
msgid "This TLD has no whois server." msgid "This TLD has no whois server."
msgstr "Diese TLD hat keinen whois-Server." msgstr "Diese TLD hat keinen Whois-Server."
#: ../whois.c:236 #: ../whois.c:236
msgid "No whois server is known for this kind of object." msgid "No whois server is known for this kind of object."
msgstr "Hierfür ist kein Whois-Server bekannt." msgstr "Für diese Art des Objekts ist kein Whois-Server bekannt."
#: ../whois.c:239 #: ../whois.c:239
msgid "Unknown AS number or IP network. Please upgrade this program." msgid "Unknown AS number or IP network. Please upgrade this program."
msgstr "" msgstr ""
"Unbekannte AS- oder IP-Netzwerk-Nummer. Bitte upgraden Sie dieses Programm." "Unbekannte AS- oder IP-Netzwerk-Nummer. Bitte führen Sie ein Upgrade dieses "
"Programms durch."
#: ../whois.c:262 #: ../whois.c:262
#, c-format #, c-format
@ -57,18 +60,18 @@ msgid ""
"\n" "\n"
msgstr "" msgstr ""
"\n" "\n"
"Frage nach dem IPv4 Endpunkt %s einer 6to4 IPv6-Adresse.\n" "Abfrage des IPv4-Endpunkts %s einer 6to4 IPv6-Adresse.\n"
"\n" "\n"
#: ../whois.c:268 #: ../whois.c:268
#, fuzzy, c-format #, c-format
msgid "" msgid ""
"\n" "\n"
"Querying for the IPv4 endpoint %s of a Teredo IPv6 address.\n" "Querying for the IPv4 endpoint %s of a Teredo IPv6 address.\n"
"\n" "\n"
msgstr "" msgstr ""
"\n" "\n"
"Frage nach dem IPv4 Endpunkt %s einer 6to4 IPv6-Adresse.\n" "Abfrage des IPv4-Endpunkts %s einer Teredo-IPv6-Adresse.\n"
"\n" "\n"
#: ../whois.c:287 #: ../whois.c:287
@ -77,7 +80,7 @@ msgid ""
"Query string: \"%s\"\n" "Query string: \"%s\"\n"
"\n" "\n"
msgstr "" msgstr ""
"Suche nach: \"%s\"\n" "Abfragezeichenkette: »%s«\n"
"\n" "\n"
#: ../whois.c:297 #: ../whois.c:297
@ -96,20 +99,20 @@ msgstr ""
#: ../whois.c:339 ../whois.c:342 #: ../whois.c:339 ../whois.c:342
#, c-format #, c-format
msgid "Cannot parse this line: %s" msgid "Cannot parse this line: %s"
msgstr "Kann diese Zeile nicht parsen: %s" msgstr "Diese Zeile kann nicht ausgewertet werden: %s"
#: ../whois.c:506 #: ../whois.c:506
msgid "Warning: RIPE flags used with a traditional server." msgid "Warning: RIPE flags used with a traditional server."
msgstr "" msgstr ""
"Warnung: RIPE-Flags wurden mit einem \"traditionellen\" Server verwendet." "Warnung: RIPE-Flags wurden mit einem »traditionellen« Server verwendet."
#: ../whois.c:657 ../whois.c:806 #: ../whois.c:657 ../whois.c:806
msgid "" msgid ""
"Catastrophic error: disclaimer text has been changed.\n" "Catastrophic error: disclaimer text has been changed.\n"
"Please upgrade this program.\n" "Please upgrade this program.\n"
msgstr "" msgstr ""
"Schwerer Fehler: Haftungsausschlusstext wurde geaendert.\n" "Katastrophaler Fehler: Haftungsausschlusstext wurde geändert.\n"
"Bitte upgraden sie dieses Programm.\n" "Bitte führen Sie ein Upgrade dieses Programms durch.\n"
#: ../whois.c:858 #: ../whois.c:858
#, c-format #, c-format
@ -123,15 +126,15 @@ msgstr "%s/tcp: unbekannter Dienst"
#: ../whois.c:943 #: ../whois.c:943
msgid "Timeout." msgid "Timeout."
msgstr "Timeout." msgstr "Zeitüberschreitung"
#: ../whois.c:949 #: ../whois.c:949
#, c-format #, c-format
msgid "Interrupted by signal %d..." msgid "Interrupted by signal %d..."
msgstr "Erhielt Signal %d, unterbrochen..." msgstr "Durch Signal %d unterbrochen ..."
#: ../whois.c:1175 #: ../whois.c:1175
#, fuzzy, c-format #, c-format
msgid "" msgid ""
"Usage: whois [OPTION]... OBJECT...\n" "Usage: whois [OPTION]... OBJECT...\n"
"\n" "\n"
@ -167,88 +170,91 @@ msgid ""
msgstr "" msgstr ""
"Aufruf: whois [OPTION]... OBJEKT...\n" "Aufruf: whois [OPTION]... OBJEKT...\n"
"\n" "\n"
"-a alle Datenbanken durchsuchen\n"
"-F \"schnelle\" Rohdatenausgabe (impliziert -r)\n"
"-g QUELLE:BEGINN-ENDE zeige Aenderungen auf QUELLE von BEGINN bis ENDE\n"
"-h HOST Verbinde zum Server HOST\n"
"-H Haftungsausschluss nicht anzeigen\n"
"-i ATTR[,ATTR]... angegebene ATTRibute rückauflösen\n"
"-x exakte Suche [nur RPSL]\n"
"-l eine Ebene unspezifischere Suche [nur RPSL]\n" "-l eine Ebene unspezifischere Suche [nur RPSL]\n"
"-L suche unspezifischere Treffer\n" "-L unspezifischere Treffer suchen\n"
"-M suche spezifischere Treffer\n" "-m eine Ebene spezifischere Treffer suchen\n"
"-m eine Ebene spezifischere Suche\n" "-M alle spezifischeren Treffer suchen\n"
"-r keine Rückwärtsauflösung\n" "-c den kleinsten Treffer suchen, der ein\n"
"-p PORT verbinde zu PORT\n" " mnt-irt-Attribut enthält.\n"
"-R zeige lokale Kopie des Domainobjekts, auch wenn es\n" "-x exakte Treffer [nur RPSL]\n"
" einen Verweis enthält\n" "-d auch DNS-Rückübertragungsobjekte zurückgeben\n"
"-S erlaube dem Server, \"syntaktischen Zucker\" \n" " [nur RPSL]\n"
" wegzulassen\n" "-i ATTR[,ATTR]... eine umgekehrte Suche für angegebene ATTRibute\n"
"-s QUELLE[,QUELLE]... suche in der Datenbank von QUELLE\n" " ausführen\n"
"-T TYP[,TYP]... suche nur nach Objekten vom Typ TYP\n" "-T TYP[,TYP]... nur nach Objekten vom Typ TYP suchen\n"
"-t TYP fordere Formular für Typ TYP an (\"all\" für eine \n" "-K nur Primärschlüssel zeigen [nur RPSL]\n"
" Liste)-v TYP fordere ausführliches " "-r Rückwärtsauflösung für Kontaktinformationen\n"
"Formular für Typ TYP an\n" " ausschalten\n"
"-q [version|quellen] frage nach angegebener Server-Information [nur RPSL]\n" "-R lokale Kopie des Domainobjekts zeigen, auch wenn es\n"
"-d zeige auch DNS-Rückübertragungsobjekte [nur RPSL]\n" " einen Verweis enthält\n"
"-K zeige nur Primärschlüssel [nur RPSL]\n" "-a alle Datenbanken durchsuchen\n"
"-V --verbose erkläre, was getan wird\n" "-s QUELLE[,QUELLE]... in der Datenbank aus der QUELLE suchen\n"
" --help zeige diese Hilfe\n" "-g QUELLE:BEGINN-ENDE finde Aktualisierungen der QUELLE von BEGINN bis ENDE\n"
" --version zeige Version\n" "-t TYP Schablone für Typ TYP anfordern (»all« für eine \n"
" Liste)\n"
"-v TYP detaillierte Schablone für Objekt des TYPs anfordern\n"
"-q [version|sources|types]\n"
" nach angegebener Server-Information fragen [nur RPSL]\n"
"-F »schnelle« Rohdatenausgabe (impliziert -r)\n"
"-h HOST zum Server HOST verbinden\n"
"-p PORT zu PORT verbinden\n"
"-H Haftungsausschluss nicht anzeigen\n"
" --verbose erklären, was getan wird\n"
" --help diese Hilfe zeigen und beenden\n"
" --version Version ausgeben und beenden\n"
#: ../mkpasswd.c:80 #: ../mkpasswd.c:80
#, fuzzy
msgid "standard 56 bit DES-based crypt(3)" msgid "standard 56 bit DES-based crypt(3)"
msgstr "\tStandard 56 Bit DES-basiertes crypt(3)" msgstr "Standard 56-Bit DES-basiertes Crypt(3)"
#: ../mkpasswd.c:162 #: ../mkpasswd.c:162
#, fuzzy, c-format #, c-format
msgid "Invalid method '%s'.\n" msgid "Invalid method '%s'.\n"
msgstr "Falsche Nummer '%s'.\n" msgstr "Ungültige Methode »%s«\n"
#: ../mkpasswd.c:171 ../mkpasswd.c:181 #: ../mkpasswd.c:171 ../mkpasswd.c:181
#, c-format #, c-format
msgid "Invalid number '%s'.\n" msgid "Invalid number '%s'.\n"
msgstr "Falsche Nummer '%s'.\n" msgstr "Falsche Nummer »%s«.\n"
#: ../mkpasswd.c:199 #: ../mkpasswd.c:199
#, c-format #, c-format
msgid "Try '%s --help' for more information.\n" msgid "Try '%s --help' for more information.\n"
msgstr "Versuchen Sie '%s --help' für mehr Informationen.\n" msgstr "Versuchen Sie »%s --help«, um weitere Informationen zu erhalten.\n"
#: ../mkpasswd.c:240 #: ../mkpasswd.c:240
#, fuzzy, c-format #, c-format
msgid "Wrong salt length: %d byte when %d expected.\n" msgid "Wrong salt length: %d byte when %d expected.\n"
msgid_plural "Wrong salt length: %d bytes when %d expected.\n" msgid_plural "Wrong salt length: %d bytes when %d expected.\n"
msgstr[0] "Falsche Salt-Länge: %d Byte(s), aber%d wurden erwartet.\n" msgstr[0] "Falsche Salt-Länge: %d Byte, aber %d wurden erwartet.\n"
msgstr[1] "Falsche Salt-Länge: %d Byte(s), aber%d wurden erwartet.\n" msgstr[1] "Falsche Salt-Länge: %d Bytes, aber %d wurden erwartet.\n"
#: ../mkpasswd.c:245 #: ../mkpasswd.c:245
#, fuzzy, c-format #, c-format
msgid "Wrong salt length: %d byte when %d <= n <= %d expected.\n" msgid "Wrong salt length: %d byte when %d <= n <= %d expected.\n"
msgid_plural "Wrong salt length: %d bytes when %d <= n <= %d expected.\n" msgid_plural "Wrong salt length: %d bytes when %d <= n <= %d expected.\n"
msgstr[0] "Falsche Salt-Länge: %d Byte(s), aber%d wurden erwartet.\n" msgstr[0] "Falsche Salt-Länge: %d Byte, aber %d <= n <= %d wurden erwartet.\n"
msgstr[1] "Falsche Salt-Länge: %d Byte(s), aber%d wurden erwartet.\n" msgstr[1] "Falsche Salt-Länge: %d Bytes, aber %d <= n <= %d wurden erwartet.\n"
#: ../mkpasswd.c:254 #: ../mkpasswd.c:254
#, c-format #, c-format
msgid "Illegal salt character '%c'.\n" msgid "Illegal salt character '%c'.\n"
msgstr "Illegaler Salt-Buchstabe '%c'.\n" msgstr "Illegales Salt-Zeichen »%c«.\n"
#: ../mkpasswd.c:299 ../mkpasswd.c:326 #: ../mkpasswd.c:299 ../mkpasswd.c:326
#, c-format #, c-format
msgid "Password: " msgid "Password: "
msgstr "Passwort:" msgstr "Passwort: "
#: ../mkpasswd.c:320 #: ../mkpasswd.c:320
#, c-format #, c-format
msgid "Illegal password character '0x%hhx'.\n" msgid "Illegal password character '0x%hhx'.\n"
msgstr "Illegaler Passwort-Buchstabe '0x%hhx'.\n" msgstr "Illegaler Passwortzeichen »0x%hhx«.\n"
#: ../mkpasswd.c:342 #: ../mkpasswd.c:342
#, c-format #, c-format
msgid "Method not supported by crypt(3).\n" msgid "Method not supported by crypt(3).\n"
msgstr "" msgstr "Methode nicht von »crypt(3)« unterstützt.\n"
#: ../mkpasswd.c:420 #: ../mkpasswd.c:420
#, c-format #, c-format
@ -258,7 +264,7 @@ msgid ""
"\n" "\n"
msgstr "" msgstr ""
"Aufruf: mkpasswd [OPTIONEN] ... [PASSWORT] [SALT]]\n" "Aufruf: mkpasswd [OPTIONEN] ... [PASSWORT] [SALT]]\n"
"Verschluesselt das PASSWORT mit crypt(3).\n" "Verschlüsselt das PASSWORT mit »crypt(3)«.\n"
"\n" "\n"
#: ../mkpasswd.c:423 #: ../mkpasswd.c:423
@ -280,26 +286,23 @@ msgid ""
"\n" "\n"
"Report bugs to %s.\n" "Report bugs to %s.\n"
msgstr "" msgstr ""
" -m, --method=TYP die Methode TYP auswählen\n"
" -5 wie --method=md5\n"
" -S, --salt=SALT angegebenes SALT benutzen\n"
" -R, --rounds=ANZAHL angegebene ANZAHL von Runden benutzen\n"
" -P, --password-fd=NUM das Passwort vom Dateideskriptor NUM anstatt\n"
" von /dev/tty lesen\n"
" -s, --stdin wie --password-fd=0\n"
" -h, --help diese Hilfe anzeigen und beenden\n"
" -V, --version Versionsinformationen anzeigen und beenden\n"
"\n"
"Falls das PASSWORT fehlt, wird es interaktiv erfragt.\n"
"Falls SALT nicht angegeben wurde, wird ein zufälliges erzeugt.\n"
"Wenn der TYP »help« ist, werden die verfügbaren Methoden ausgegeben.\n"
"\n"
"Berichten Sie Fehler auf Englisch an %s.\n"
#: ../mkpasswd.c:452 #: ../mkpasswd.c:452
#, fuzzy, c-format #, c-format
msgid "Available methods:\n" msgid "Available methods:\n"
msgstr "Verfügbare Algorithmen:\n" msgstr "Verfügbare Methoden:\n"
#~ msgid "Invalid hash type '%s'.\n"
#~ msgstr "Falscher Hash-Typ '%s'.\n"
#~ msgid "Using default server %s.\n"
#~ msgstr "Benutze voreingestellten Server %s.\n"
#~ msgid ""
#~ "\n"
#~ "Found referral to %s.\n"
#~ "\n"
#~ msgstr ""
#~ "\n"
#~ "Verweis auf %s gefunden.\n"
#~ "\n"
#~ msgid "Detected referral to %s on %s.\n"
#~ msgstr "Verweis auf %s gefunden bei %s.\n"

View File

@ -147,7 +147,7 @@
.gq NONE # NO NIC http://www.getesa.gq/ .gq NONE # NO NIC http://www.getesa.gq/
.gr WEB https://grweb.ics.forth.gr/Whois?lang=en .gr WEB https://grweb.ics.forth.gr/Whois?lang=en
.gs whois.nic.gs .gs whois.nic.gs
.gt WEB http://www.gt/whois.htm .gt WEB http://www.gt/whois.html
.gu WEB http://gadao.gov.gu/domainsearch.htm .gu WEB http://gadao.gov.gu/domainsearch.htm
.gw NONE # www.gwregister.com .gw NONE # www.gwregister.com
.gy whois.registry.gy .gy whois.registry.gy

39
whois.c
View File

@ -34,6 +34,9 @@
#ifdef HAVE_LIBIDN #ifdef HAVE_LIBIDN
#include <idna.h> #include <idna.h>
#endif #endif
#ifdef HAVE_INET_PTON
#include <arpa/inet.h>
#endif
/* Application-specific */ /* Application-specific */
#include "data.h" #include "data.h"
@ -430,7 +433,12 @@ const char *guess_server(const char *s)
return whereas32(as32); return whereas32(as32);
/* smells like an IP? */ /* smells like an IP? */
#ifdef HAVE_INET_PTON
if (inet_pton(AF_INET, s, &ip) > 0) {
ip = ntohl(ip);
#else
if ((ip = myinet_aton(s))) { if ((ip = myinet_aton(s))) {
#endif
for (i = 0; ip_assign[i].serv; i++) for (i = 0; ip_assign[i].serv; i++)
if ((ip & ip_assign[i].mask) == ip_assign[i].net) if ((ip & ip_assign[i].mask) == ip_assign[i].net)
return ip_assign[i].serv; return ip_assign[i].serv;
@ -1076,6 +1084,18 @@ void split_server_port(const char *const input,
char *convert_6to4(const char *s) char *convert_6to4(const char *s)
{ {
char *new; char *new;
#ifdef HAVE_INET_PTON
struct in6_addr ipaddr;
unsigned char *ip;
if (inet_pton(AF_INET6, s, &ipaddr) <= 0)
return strdup("0.0.0.0");
ip = (unsigned char *)&ipaddr;
new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%d.%d.%d.%d", *(ip + 2), *(ip + 3), *(ip + 4), *(ip + 5));
#else
unsigned int a, b; unsigned int a, b;
if (sscanf(s, "2002:%x:%x:", &a, &b) != 2) if (sscanf(s, "2002:%x:%x:", &a, &b) != 2)
@ -1083,12 +1103,27 @@ char *convert_6to4(const char *s)
new = malloc(sizeof("255.255.255.255")); new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%d.%d.%d.%d", a >> 8, a & 0xff, b >> 8, b & 0xff); sprintf(new, "%d.%d.%d.%d", a >> 8, a & 0xff, b >> 8, b & 0xff);
#endif
return new; return new;
} }
char *convert_teredo(const char *s) char *convert_teredo(const char *s)
{ {
char *new; char *new;
#ifdef HAVE_INET_PTON
struct in6_addr ipaddr;
unsigned char *ip;
if (inet_pton(AF_INET6, s, &ipaddr) <= 0)
return strdup("0.0.0.0");
ip = (unsigned char *)&ipaddr;
new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%d.%d.%d.%d", *(ip + 12) ^ 0xff, *(ip + 13) ^ 0xff,
*(ip + 14) ^ 0xff, *(ip + 15) ^ 0xff);
#else
unsigned int a, b; unsigned int a, b;
if (sscanf(s, "2001:%*[^:]:%*[^:]:%*[^:]:%*[^:]:%*[^:]:%x:%x", &a, &b) != 2) if (sscanf(s, "2001:%*[^:]:%*[^:]:%*[^:]:%*[^:]:%*[^:]:%x:%x", &a, &b) != 2)
@ -1098,6 +1133,8 @@ char *convert_teredo(const char *s)
b ^= 0xffff; b ^= 0xffff;
new = malloc(sizeof("255.255.255.255")); new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%d.%d.%d.%d", a >> 8, a & 0xff, b >> 8, b & 0xff); sprintf(new, "%d.%d.%d.%d", a >> 8, a & 0xff, b >> 8, b & 0xff);
#endif
return new; return new;
} }
@ -1133,6 +1170,7 @@ char *convert_inaddr(const char *s)
return new; return new;
} }
#ifndef HAVE_INET_PTON
unsigned long myinet_aton(const char *s) unsigned long myinet_aton(const char *s)
{ {
unsigned long a, b, c, d; unsigned long a, b, c, d;
@ -1148,6 +1186,7 @@ unsigned long myinet_aton(const char *s)
return 0; return 0;
return (a << 24) + (b << 16) + (c << 8) + d; return (a << 24) + (b << 16) + (c << 8) + d;
} }
#endif
unsigned long asn32_to_long(const char *s) unsigned long asn32_to_long(const char *s)
{ {

View File

@ -1,6 +1,6 @@
Summary: Enhanced WHOIS client Summary: Enhanced WHOIS client
Name: whois Name: whois
Version: 5.0.1 Version: 5.0.2
Release: 1 Release: 1
License: GPL License: GPL
Vendor: Marco d'Itri <md@linux.it> Vendor: Marco d'Itri <md@linux.it>