diff options
-rw-r--r-- | Makefile | 24 | ||||
-rw-r--r-- | config.h | 9 | ||||
-rw-r--r-- | data.h | 30 | ||||
-rw-r--r-- | debian/changelog | 11 | ||||
-rw-r--r-- | ip_del_list | 3 | ||||
-rw-r--r-- | mkpasswd.c | 35 | ||||
-rw-r--r-- | tld_serv_list | 13 | ||||
-rw-r--r-- | whois.c | 26 |
8 files changed, 100 insertions, 51 deletions
@@ -1,12 +1,9 @@ prefix ?= /usr/local -OPTS=-O2 +OPTS := -O2 # Solaris -#LDFLAGS=-lnsl -lsocket - -# obsolete linux (libc 5) -#LDFLAGS=-lintl +#whois_LDADD += -lnsl -lsocket # FreeBSD #LDFLAGS=-L/usr/local/lib -lgnugetopt -lintl @@ -16,8 +13,15 @@ OPTS=-O2 #LDFLAGS=-lsocket -Zexe -Dstrncasecmp=strnicmp ifdef HAVE_LIBIDN -LIBIDN += -lidn -CFLAGS += -DHAVE_LIBIDN +whois_LDADD += -lidn +whois_CFLAGS += -DHAVE_LIBIDN +endif + +ifdef HAVE_XCRYPT +mkpasswd_LDADD += -lxcrypt +mkpasswd_CFLAGS += -DHAVE_XCRYPT +else +mkpasswd_LDADD += -lcrypt endif PERL := perl @@ -25,10 +29,12 @@ PERL := perl all: whois #pos whois: whois.c whois.h config.h data.h as_del.h ip_del.h ip6_del.h tld_serv.h - $(CC) $(CFLAGS) $(OPTS) whois.c -o whois $(LDFLAGS) $(LIBIDN) + $(CC) $(CFLAGS) $(whois_CFLAGS) $(OPTS) whois.c -o whois \ + $(LDFLAGS) $(whois_LDADD) mkpasswd: mkpasswd.c - $(CC) $(CFLAGS) $(OPTS) mkpasswd.c -o mkpasswd -lcrypt + $(CC) $(CFLAGS) $(mkpasswd_CFLAGS) $(OPTS) mkpasswd.c -o mkpasswd \ + $(LDFLAGS) $(mkpasswd_LDADD) as_del.h: as_del_list make_as_del.pl $(PERL) -w make_as_del.pl < as_del_list > as_del.h @@ -1,6 +1,6 @@ /* Program version */ /* not for the inetutils version */ -#define VERSION "4.7.6" +#define VERSION "4.7.7" /* Configurable features */ @@ -41,7 +41,12 @@ # endif #endif -#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 +/* Linux, Solaris 5, FreeBSD 5.x. What else? */ +#if defined _POSIX_VERSION && _POSIX_VERSION >= 200112L +# define HAVE_WORDEXP +#endif + +#if defined _POSIX2_VERSION # define HAVE_REGEXEC #endif @@ -29,32 +29,32 @@ const char *ripe_servers[] = { }; const char *hide_strings[] = { - "NOTICE AND TERMS OF USE: You", "Network Solutions reserves",/* Verisign */ + "NOTICE AND TERMS OF USE: You", "", /* NetSol */ "NOTICE: The expiration date", "reserves the right to", /* crsnic */ - "NOTICE: Access to .ORG WHOIS", "time. By submitting", /* org */ - "NOTICE: Access to .INFO WHOIS", "time. By submitting", /* info */ + "NOTICE: Access to .ORG WHOIS", "", /* org */ + "NOTICE: Access to .INFO WHOIS", "", /* info */ "This Registry database contains ONLY .EDU", "type: help", /* edu */ - "The data in Register", "By submitting", /* REGISTER.COM */ - "The Data in the Tucows", "RECORD DOES NOT", /* tucows */ - " The data contained in the WHOIS", "Please limit your", /* DOTSTER */ + "The data in Register", "", /* Register.Com */ + "The Data in the Tucows", "RECORD DOES NOT", + " The data contained in the WHOIS", "", /* DOTSTER */ "This whois service currently only", "top-level domains.", "Signature Domains' Whois Service", "agree to abide by the above", "Access to ASNIC", "by this policy.", /* as */ "The Data in Gabia", "you agree to abide", - "The data contained in Go Daddy", "is not the registrant", /* Go Daddy */ + "The data contained in Go Daddy", "is not the registrant", "Disclaimer: The Global Name Registry", "for any commercial", "Access to America Online", "time. By accessing", /* AOL */ - "% Access and use restricted", "% http://www.icann", /* GANDI */ + "% Access and use restricted", "", /* GANDI */ + "% The data in the WHOIS database of Schlund", "", "NeuStar, Inc., the Registry", "rules. For details", /* us */ - "The data in this whois database is", "Version 6.", /* enom */ + "The data in this whois database is", "", /* enom */ "By submitting a WHOIS query, you agree you will", "LACK OF A DOMAIN", /* directNIC */ - "The Data in Moniker.com", "this query, you agree", - "The Data in OnlineNIC", " By starting this query", /* OnlineNIC */ - "The data in Bulkregister.com", "you agree to abide", /* bulkregister */ - "The Data in Alldomains.com's", "By submitting this query,",/*alldomains*/ + "The Data in Moniker.Com", "", + "The Data in OnlineNIC", " By starting this query", + "The data in Bulkregister", "", "Interdomain's WHOIS", "DOES NOT SIGNIFY", - "The Data provided by Stargate.com", "(2) enable any", - "; This data is provided by dd24", "; By submitting this query", + "The Data provided by Stargate Holdings", "(2) enable any", + "; This data is provided by domaindiscount24.com", "", NULL, NULL }; diff --git a/debian/changelog b/debian/changelog index 035e29a..5d2abe3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +whois (4.7.7) unstable; urgency=medium + + * Added the .bj, .ht and .ky TLD servers. + * Updated the .kz and .uz TLD servers. + * Added support for -afrinic NIC handles. + * Checked the whole hide_strings[], updated when needed. (Closes: #317583) + * Added to mkpasswd some preliminary and non-working support for libxcrypt. + Patches are welcome. + + -- Marco d'Itri <md@linux.it> Sun, 11 Sep 2005 16:04:48 +0200 + whois (4.7.6) unstable; urgency=medium * Added new ASN and IP allocations. diff --git a/ip_del_list b/ip_del_list index 1856891..120aa98 100644 --- a/ip_del_list +++ b/ip_del_list @@ -180,6 +180,9 @@ 218.40.0.0/13 whois.nic.ad.jp 218.48.0.0/13 whois.nic.or.kr 218.144.0.0/12 whois.nic.or.kr +218.160.0.0/12 twnic +218.216.0.0/13 whois.nic.ad.jp +218.224.0.0/13 whois.nic.ad.jp 218.232.0.0/13 whois.nic.or.kr 219.240.0.0/15 whois.nic.or.kr 219.248.0.0/13 whois.nic.or.kr @@ -45,18 +45,24 @@ static char valid_salts[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; struct salt_prefix { - const char *algo; - const char *prefix; - unsigned int len; - const char *desc; + const char *algo; /* short name used by the command line option */ + const char *prefix; /* salt prefix */ + unsigned int len; /* salt lenght */ + const char *desc; /* long description for the algorithms list */ }; struct salt_prefix salt_prefixes[] = { { "des", "", 2, N_("\tstandard 56 bit DES-based crypt(3)") }, { "md5", "$1$", 8, "\tMD5" }, +/* untested! is the salt correctly generated? */ #if defined OpenBSD || defined FreeBSD { "blf", "$2$", 16, "\tBlowfish" }, #endif +/* untested too, and does not even compile */ +#if defined HAVE_XCRYPT + { "blf", "$2a$", 16, "\tBlowfish" }, + { "sha", "{SHA}", , "\tSHA-1" }, +#endif { NULL, NULL, 0, NULL } }; @@ -160,8 +166,18 @@ int main(int argc, char *argv[]) exit(1); } } else { +#ifdef HAVE_XCRYPT + char *entropy = gather_entropy(4096); + salt = crypt_gensalt(salt_prefix, 0, entropy, 4096); + if (!salt) { + perror("crypt"); + exit(2); + } + free(entropy); +#else salt = malloc(salt_len + 1); generate_salt(salt, salt_len); +#endif } if (!password) { @@ -206,16 +222,22 @@ int main(int argc, char *argv[]) } { - char *pw; + char *pw, *result; pw = malloc(strlen(salt_prefix) + strlen(salt) + 1); *pw = '\0'; strcat(pw, salt_prefix); strcat(pw, salt); - printf("%s\n", crypt(password, pw)); + result = crypt(password, pw); + if (!result) { + perror("crypt"); + exit(2); + } + printf("%s\n", result); } exit(0); } +#ifndef HAVE_XCRYPT void generate_salt(char *buf, const unsigned int len) { unsigned int i; @@ -225,6 +247,7 @@ void generate_salt(char *buf, const unsigned int len) buf[i] = valid_salts[rand() % (sizeof valid_salts - 1)]; buf[i] = '\0'; } +#endif void display_help(void) { diff --git a/tld_serv_list b/tld_serv_list index d6c286b..dc1fe42 100644 --- a/tld_serv_list +++ b/tld_serv_list @@ -62,7 +62,7 @@ .bg whois.register.bg #.bh NONE # NIC? www.inet.com.bh .bi WEB http://www.nic.bi/Nic_search.asp -#.bj # NIC? www.opt.bj +.bj whois.nic.bj .bm WEB http://207.228.133.14/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO #.bn NONE # NIC? www.brunet.bn .bo WEB http://www.nic.bo/ @@ -108,7 +108,7 @@ #.et NONE # NIC? www.telecom.net.et .fi whois.ficora.fi .fj whois.usp.ac.fj -.fk NONE # http://www.fidc.org.fk/domain-registration/home.htm +.fk NONE # http://www.fidc.org.fk/ .fm WEB http://www.dot.fm/whois.html .fo whois.ripe.net # www.nic.fo .fr whois.nic.fr @@ -136,7 +136,7 @@ .hm whois.registry.hm .hn NONE # http://www.nic.hn/busquedas/ .hr WEB http://www.dns.hr/pretrazivanje.html -.ht NONE # http://www.nic.ht/ +.ht WEB http://www.nic.ht/info/whois.cfm .hu whois.nic.hu .id whois.idnic.net.id .ie whois.domainregistry.ie @@ -161,8 +161,8 @@ #.kp .kr whois.nic.or.kr .kw WEB http://www.domainname.net.kw -.ky NONE # http://www.icta.ky/dev/da_ky_reg_dom.php www.nic.ky -.kz whois.domain.kz +.ky WEB http://kynseweb.messagesecure.com/kywebadmin/ # http://www.icta.ky/ +.kz whois.nic.kz .la whois.nic.la .lb WEB http://www.aub.edu.lb/lbdr/search.html .lc NONE # http://www.isisworld.lc/domains/ @@ -275,7 +275,7 @@ .us whois.nic.us .com.uy WEB http://dns.antel.net.uy/clientes/consultar.htm .uy WEB http://www.rau.edu.uy/rau/dom/ -.uz WEB http://www.noc.uz/dom_01.htm +.uz whois.cctld.uz .va whois.ripe.net .vc whois.opensrs.net .ve WEB http://www.nic.ve/ # rwhois.reacciun.ve:4321 @@ -302,6 +302,7 @@ -ripe whois.ripe.net -mnt whois.ripe.net -lacnic whois.lacnic.net +-afrinic whois.afrinic.net -gandi whois.gandi.net -ap whois.apnic.net -ar whois.aunic.net @@ -491,20 +491,20 @@ int hide_line(int *hiding, const char *const line) } return 0; /* don't hide this line */ } else if (*hiding > HIDE_UNSTARTED) { /* hiding something */ - if (strncmp(line, hide_strings[*hiding + 1], - strlen(hide_strings[*hiding + 1])) == 0) { - *hiding = HIDE_DISABLED; /* stop hiding */ - return 1; /* but hide the last line */ + if (*hide_strings[*hiding + 1] == '\0') { /*look for a blank line?*/ + if (*line == '\n' || *line == '\r' || *line == '\0') { + *hiding = HIDE_DISABLED; /* stop hiding */ + return 0; /* but do not hide the blank line */ + } + } else { /*look for a matching string*/ + if (strncmp(line, hide_strings[*hiding + 1], + strlen(hide_strings[*hiding + 1])) == 0) { + *hiding = HIDE_DISABLED; /* stop hiding */ + return 1; /* but hide the last line */ + } } return 1; /* we are hiding, so do it */ - } -#if 0 - /* XXX */ - /* no match, the action depends on the state stored in *hiding */ - if (*hiding > HIDE_UNSTARTED) - return 1; - else -#endif + } else return 0; } @@ -519,7 +519,7 @@ const char *do_query(const int sock, const char *query) fi = fdopen(sock, "r"); if (write(sock, query, strlen(query)) < 0) err_sys("write"); -/* Using shutdown breaks the buggy RIPE server. +/* Using shutdown used to break the buggy RIPE server. Would this work now? if (shutdown(sock, 1) < 0) err_sys("shutdown"); */ |