Hello community, here is the log from the commit of package whois for openSUSE:Factory checked in at 2014-09-15 17:41:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/whois (Old) and /work/SRC/openSUSE:Factory/.whois.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "whois" Changes: -------- --- /work/SRC/openSUSE:Factory/whois/whois.changes 2014-08-04 15:14:39.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.whois.new/whois.changes 2014-09-15 18:24:43.000000000 +0200 @@ -1,0 +2,11 @@ +Sat Sep 13 11:52:06 UTC 2014 - andreas.stieger@gmx.de + +- whois 5.2.0: + * Implemented support for the long RIPE flags. + * "Fixed" some harmless bugs discovered with a Coverity scan. + * Default to whois.ripe.net when using long flags. + * Updated the list of new gTLDs. + * Added a new ASN allocation. + * Added new recovered IPv4 allocations. + +------------------------------------------------------------------- Old: ---- whois_5.1.5.tar.xz New: ---- whois_5.2.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ whois.spec ++++++ --- /var/tmp/diff_new_pack.WlmB8b/_old 2014-09-15 18:24:45.000000000 +0200 +++ /var/tmp/diff_new_pack.WlmB8b/_new 2014-09-15 18:24:45.000000000 +0200 @@ -17,7 +17,7 @@ Name: whois -Version: 5.1.5 +Version: 5.2.0 Release: 0 Summary: Intelligent WHOIS client License: GPL-2.0+ ++++++ whois.asc ++++++ --- /var/tmp/diff_new_pack.WlmB8b/_old 2014-09-15 18:24:45.000000000 +0200 +++ /var/tmp/diff_new_pack.WlmB8b/_new 2014-09-15 18:24:45.000000000 +0200 @@ -5,7 +5,7 @@ Source: whois Binary: whois Architecture: any -Version: 5.1.5 +Version: 5.2.0 Maintainer: Marco d'Itri <md@linux.it> Standards-Version: 3.9.5 Vcs-Browser: https://github.com/rfc1036/whois @@ -14,23 +14,23 @@ Package-List: whois deb net standard arch=any Checksums-Sha1: - 8b2c626a9cb5f6868931ca9d0e374753a88e98b0 77176 whois_5.1.5.tar.xz + 1678a34b7b055750ba6f10d93eaa3b6c63993645 78088 whois_5.2.0.tar.xz Checksums-Sha256: - d4a192d6208f1ed3856b5089e2de5fc986031c96148b97c9ef43af7a21af1a9d 77176 whois_5.1.5.tar.xz + f487bba00fc506b18b519d913509d9e050cba0b6f025e26a50b29b3e6322530b 78088 whois_5.2.0.tar.xz Files: - 2723e8916cb301999466fd0017d00def 77176 whois_5.1.5.tar.xz + 0e5966b051735fff91792fa40c3d030f 78088 whois_5.2.0.tar.xz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 -iQGcBAEBCAAGBQJT3EJFAAoJECv1pcEixPekpHcL/RljfacE5ptOFb20e6e59QmG -WZSJ+S/GUtTfTCLBzJvBH/6CWEBr+/V9yH9qA2CYtc7wzqqxkEQFdSJ3XlOuQrJH -xbI1o7mthSum2z6LRVPkQLlaSz3wNDidnCPicC4bDXrTdYzl/SN9ljJhgrZuXvhC -rzGXcfXeTzmEA9pBeGTcVLL6/2BH6z5rmQbInC8A1mby296UBPpV45i7zxq5/zuG -zScSH7MPOrF1PIP3XUX4trAc7kxt02YgW/bvawwWMS4u0Tq+H1GpL31aixZP9uS2 -7Avq9/2GadUpW1O+HOL+eVOWahb3nTUSDWSKzhoPPomunv8QdAYX6uKogQBly4Ey -gWB5Zo+fmaCUOK1QDUiGSt6i4HuSfIvQcGHEUjFj/1vEZj5Ze5NHuOM+KSPzdNnE -s9NGhPvM66ByxmpPYIJ49MIZTr3r+OSdKqT6pz7ZJoFfLvfhdWm4OHhs1EYOwTSX -Q9I9a+/MBNjVYF75pg6NEGyNzeshr6COwoy9mqVp7w== -=6kCc +iQGcBAEBCAAGBQJUE7crAAoJECv1pcEixPekr2oMALDu10HDdonpw5m8ENJBawyU +5PMfYlVZVfUy/vrwtRnEq70Kks8Huu8Eh4Eq3KsOK7p3waW41SvGbS1xmpkmqUBr +ymWN/fhHFweA8I1mPAAvmdxIuGfOE+XuTCHN43rJFdlRN3Db8+sPXQW54jRP+BuY +606q+L2/dJTfIvXtQEfmBrGwvNxtwK7pH4SZPjlIjbho/LyfMKgXe1A8XwLAh6tu +rGwkhWYJqCSKhW0oqXQImRHHemNiJyj9IVbTfrDhQSoBAnqjFZ+AtGoaNvmMCsaT +70nrcCI9VIsqLmf2jrPJWQ5zEizYpVWuLxdyHtZuQRS4ST3K/gYsmeun+p471w/2 +yDljzAFpcEm0pVlQBU/vVj8CIIGaDOxTiiBAeuc/gJZ7WrPMVNXTZJtPaEp8vHSH +Kk4xwl9o0nt85xwZytb/A4ufQDGJ5lv0E5sm+9K5lBKQQ/p07ONF4aYRMCDIQKhA +I/S3zqhSLluCTjxZgaCMjegzbE4GWYV7PFyEx5mAhg== +=f0jB -----END PGP SIGNATURE----- ++++++ whois_5.1.5.tar.xz -> whois_5.2.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/as_del_list new/whois-5.2.0/as_del_list --- old/whois-5.1.5/as_del_list 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/as_del_list 2014-09-03 01:28:54.000000000 +0200 @@ -87,7 +87,7 @@ 61952 62463 ripe # catch all: everything else comes from ARIN 1 63487 arin -63488 63999 apnic +63488 64098 apnic # documentation and private ASN block 64496 65534 ripe diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/debian/changelog new/whois-5.2.0/debian/changelog --- old/whois-5.1.5/debian/changelog 2014-08-02 03:42:22.000000000 +0200 +++ new/whois-5.2.0/debian/changelog 2014-09-13 05:13:21.000000000 +0200 @@ -1,3 +1,15 @@ +whois (5.2.0) unstable; urgency=medium + + * Implemented support for the long RIPE flags. + * "Fixed" some harmless bugs discovered with a Coverity scan. + * Default to whois.ripe.net when using long flags. + * Updated the list of new gTLDs. + * Added a new ASN allocation. + * Added new recovered IPv4 allocations. + * Updated make_version_h.pl to support Debian binNMUs. (Closes: #761318) + + -- Marco d'Itri <md@linux.it> Sat, 13 Sep 2014 05:05:16 +0200 + whois (5.1.5) unstable; urgency=medium * Updated the list of new gTLDs. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/ip_del_recovered.h new/whois-5.2.0/ip_del_recovered.h --- old/whois-5.1.5/ip_del_recovered.h 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/ip_del_recovered.h 2014-09-03 01:28:54.000000000 +0200 @@ -2,11 +2,16 @@ { 736886784UL, 737411071UL, "whois.apnic.net" }, { 737476608UL, 738000895UL, "whois.apnic.net" }, { 738066432UL, 738197503UL, "whois.apnic.net" }, +{ 756023296UL, 757071871UL, "whois.arin.net" }, { 757071872UL, 759169023UL, "whois.arin.net" }, { 759169024UL, 759238655UL, "whois.apnic.net" }, +{ 760217600UL, 761266175UL, "whois.ripe.net" }, +{ 761266176UL, 762314751UL, "whois.afrinic.net" }, +{ 762314752UL, 763363327UL, "whois.apnic.net" }, { 763363328UL, 765460479UL, "whois.ripe.net" }, { 765460480UL, 767557631UL, "whois.lacnic.net" }, { 767557632UL, 769589247UL, "whois.afrinic.net" }, +{ 769654784UL, 770703359UL, "whois.lacnic.net" }, { 2523594752UL, 2523660287UL, "whois.apnic.net" }, { 2525036544UL, 2525102079UL, "whois.apnic.net" }, { 2532442112UL, 2532507647UL, "whois.apnic.net" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/make_version_h.pl new/whois-5.2.0/make_version_h.pl --- old/whois-5.1.5/make_version_h.pl 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/make_version_h.pl 2014-09-13 05:13:19.000000000 +0200 @@ -2,17 +2,18 @@ use warnings; use strict; +use autodie; my $changelog = $ARGV[0] or die "Usage: $0 debian/changelog\n"; -open(my $fh, '<', $changelog) or die "open($changelog): $!"; +open(my $fh, '<', $changelog); my $line = <$fh>; -close($fh) or die "close($changelog): $!"; +close($fh); my ($ver) = $line =~ /^whois \s+ \( ( [^\)]+ ) \) \s+ \S+/x; die "Version number not found in $changelog!\n" if not $ver; -$ver =~ s/ ( ~bpo\d+\+\d+ | ~deb\d+.* | ubuntu\d+ | \+dyson\d+ ) $//x; +$ver =~ s/ ( ~bpo\d+\+\d+ | \+b\d+ | ~deb\d+.* | ubuntu\d+ | \+dyson\d+ ) $//x; # The version number must not deviate from this format or the -V option # to RIPE-like servers will break. If needed, update the previous regexp. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/mkpasswd.c new/whois-5.2.0/mkpasswd.c --- old/whois-5.1.5/mkpasswd.c 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/mkpasswd.c 2014-09-13 02:42:29.000000000 +0200 @@ -115,7 +115,7 @@ }; void generate_salt(char *const buf, const unsigned int len); -void *get_random_bytes(const int len); +void *get_random_bytes(const unsigned int len); void display_help(int error); void display_version(void); void display_methods(void); @@ -351,10 +351,10 @@ } #ifdef RANDOM_DEVICE -void* get_random_bytes(const int count) +void* get_random_bytes(const unsigned int count) { char *buf; - int fd; + int fd, bytes_read; buf = NOFAIL(malloc(count)); fd = open(RANDOM_DEVICE, O_RDONLY); @@ -362,11 +362,13 @@ perror("open(" RANDOM_DEVICE ")"); exit(2); } - if (read(fd, buf, count) != count) { - if (count < 0) - perror("read(" RANDOM_DEVICE ")"); - else - fprintf(stderr, "Short read of %s.\n", RANDOM_DEVICE); + bytes_read = read(fd, buf, count); + if (bytes_read < 0) { + perror("read(" RANDOM_DEVICE ")"); + exit(2); + } + if (bytes_read != count) { + fprintf(stderr, "Short read of %s.\n", RANDOM_DEVICE); exit(2); } close(fd); @@ -385,6 +387,7 @@ for (i = 0; i < len; i++) buf[i] = valid_salts[entropy[i] % (sizeof valid_salts - 1)]; buf[i] = '\0'; + free(entropy); } #else /* RANDOM_DEVICE */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/new_gtlds.h new/whois-5.2.0/new_gtlds.h --- old/whois-5.1.5/new_gtlds.h 2014-07-25 07:15:00.000000000 +0200 +++ new/whois-5.2.0/new_gtlds.h 2014-09-13 05:15:04.000000000 +0200 @@ -25,10 +25,13 @@ ".blackfriday", ".blue", ".bmw", + ".bnpparibas", + ".boo", ".boutique", ".brussels", ".build", ".builders", + ".business", ".buzz", ".bzh", ".cab", @@ -37,6 +40,7 @@ ".cancerresearch", ".capetown", ".capital", + ".caravan", ".cards", ".care", ".career", @@ -45,6 +49,7 @@ ".catering", ".center", ".ceo", + ".cern", ".cheap", ".christmas", ".church", @@ -52,6 +57,7 @@ ".city", ".claims", ".cleaning", + ".click", ".clinic", ".clothing", ".club", @@ -74,8 +80,11 @@ ".creditcard", ".cruises", ".cuisinella", + ".cymru", + ".dad", ".dance", ".dating", + ".day", ".deals", ".degree", ".democrat", @@ -83,6 +92,7 @@ ".dentist", ".desi", ".diamonds", + ".diet", ".digital", ".direct", ".directory", @@ -90,12 +100,14 @@ ".dnp", ".domains", ".durban", + ".eat", ".education", ".email", ".engineer", ".engineering", ".enterprises", ".equipment", + ".esq", ".estate", ".eus", ".events", @@ -114,19 +126,24 @@ ".florist", ".foo", ".foundation", + ".frl", ".frogans", ".fund", ".furniture", ".futbol", ".gal", ".gallery", + ".gbiz", ".gent", ".gift", + ".gifts", ".gives", ".glass", ".global", ".globo", + ".gmail", ".gmo", + ".gmx", ".gop", ".graphics", ".gratis", @@ -137,6 +154,9 @@ ".guru", ".hamburg", ".haus", + ".healthcare", + ".help", + ".here", ".hiphop", ".hiv", ".holdings", @@ -144,10 +164,14 @@ ".homes", ".horse", ".host", + ".hosting", ".house", + ".how", + ".immo", ".immobilien", ".industries", ".info", + ".ing", ".ink", ".institute", ".insure", @@ -176,6 +200,7 @@ ".loans", ".london", ".lotto", + ".ltda", ".luxe", ".luxury", ".maison", @@ -186,6 +211,7 @@ ".media", ".meet", ".melbourne", + ".meme", ".menu", ".miami", ".mini", @@ -195,10 +221,13 @@ ".mortgage", ".moscow", ".motorcycles", + ".mov", ".nagoya", ".navy", ".net", + ".network", ".neustar", + ".new", ".ngo", ".nhk", ".ninja", @@ -206,13 +235,17 @@ ".nrw", ".nyc", ".okinawa", + ".ong", ".onl", + ".ooo", ".org", ".organic", + ".otsuka", ".ovh", ".paris", ".partners", ".parts", + ".pharmacy", ".photo", ".photography", ".photos", @@ -220,15 +253,19 @@ ".pics", ".pictures", ".pink", + ".pizza", ".place", ".plumbing", ".praxi", ".press", + ".prod", ".productions", ".properties", + ".property", ".pub", ".qpon", ".quebec", + ".realtor", ".recipes", ".red", ".rehab", @@ -240,14 +277,18 @@ ".report", ".republican", ".rest", + ".restaurant", ".reviews", ".rich", ".rio", ".rocks", ".rodeo", + ".rsvp", ".ruhr", ".ryukyu", ".saarland", + ".sarl", + ".sca", ".scb", ".schmidt", ".schule", @@ -272,6 +313,7 @@ ".surgery", ".suzuki", ".systems", + ".tatar", ".tattoo", ".tax", ".technology", @@ -281,12 +323,14 @@ ".today", ".tokyo", ".tools", + ".top", ".town", ".toys", ".trade", ".training", ".university", ".uno", + ".uol", ".vacations", ".vegas", ".ventures", @@ -301,6 +345,7 @@ ".voting", ".voto", ".voyage", + ".wales", ".wang", ".watch", ".webcam", @@ -309,9 +354,12 @@ ".whoswho", ".wien", ".wiki", + ".williamhill", + ".wme", ".works", ".wtc", ".wtf", + ".xn--1qqw23a", ".xn--3bst00m", ".xn--3ds443g", ".xn--4gbrim", @@ -340,9 +388,12 @@ ".xn--rhqv96g", ".xn--ses554g", ".xn--unup4y", + ".xn--vhquv", + ".xn--xhq521b", ".xn--zfr164b", ".xyz", ".yachts", ".yandex", ".yokohama", + ".youtube", ".zone", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/new_gtlds_list new/whois-5.2.0/new_gtlds_list --- old/whois-5.1.5/new_gtlds_list 2014-08-02 03:41:06.000000000 +0200 +++ new/whois-5.2.0/new_gtlds_list 2014-09-13 05:13:16.000000000 +0200 @@ -31,10 +31,13 @@ blackfriday blue bmw +bnpparibas +boo boutique brussels build builders +business buzz bzh cab @@ -43,6 +46,7 @@ cancerresearch capetown capital +caravan cards care career @@ -51,6 +55,7 @@ catering center ceo +cern cheap christmas church @@ -58,6 +63,7 @@ city claims cleaning +click clinic clothing club @@ -80,8 +86,11 @@ creditcard cruises cuisinella +cymru +dad dance dating +day deals degree democrat @@ -89,6 +98,7 @@ dentist desi diamonds +diet digital direct directory @@ -96,12 +106,14 @@ dnp domains durban +eat education email engineer engineering enterprises equipment +esq estate eus events @@ -120,19 +132,24 @@ florist foo foundation +frl frogans fund furniture futbol gal gallery +gbiz gent gift +gifts gives glass global globo +gmail gmo +gmx gop graphics gratis @@ -144,6 +161,8 @@ hamburg haus healthcare +help +here hiphop hiv holdings @@ -151,10 +170,14 @@ homes horse host +hosting house +how +immo immobilien industries info +ing ink institute insure @@ -183,6 +206,7 @@ loans london lotto +ltda luxe luxury maison @@ -193,6 +217,7 @@ media meet melbourne +meme menu miami mini @@ -202,10 +227,13 @@ mortgage moscow motorcycles +mov nagoya navy net +network neustar +new ngo nhk ninja @@ -215,12 +243,15 @@ okinawa ong onl +ooo org organic +otsuka ovh paris partners parts +pharmacy photo photography photos @@ -228,12 +259,15 @@ pics pictures pink +pizza place plumbing praxi press +prod productions properties +property pub qpon quebec @@ -249,14 +283,18 @@ report republican rest +restaurant reviews rich rio rocks rodeo +rsvp ruhr ryukyu saarland +sarl +sca scb schmidt schule @@ -281,6 +319,7 @@ surgery suzuki systems +tatar tattoo tax technology @@ -290,12 +329,14 @@ today tokyo tools +top town toys trade training university uno +uol vacations vegas ventures @@ -310,6 +351,7 @@ voting voto voyage +wales wang watch webcam @@ -319,9 +361,11 @@ wien wiki williamhill +wme works wtc wtf +xn--1qqw23a xn--3bst00m xn--3ds443g xn--4gbrim @@ -350,9 +394,12 @@ xn--rhqv96g xn--ses554g xn--unup4y +xn--vhquv +xn--xhq521b xn--zfr164b xyz yachts yandex yokohama +youtube zone diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/tld_serv_list new/whois-5.2.0/tld_serv_list --- old/whois-5.1.5/tld_serv_list 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/tld_serv_list 2014-08-21 02:35:29.000000000 +0200 @@ -226,7 +226,7 @@ .mv NONE # NIC? www.dhiraagu.com.mv .mw WEB http://www.registrar.mw/ .mx whois.mx -.my whois.domainregistry.my +.my whois.mynic.my .mz NONE # NIC? www.uem.mz .na whois.na-nic.com.na .nc whois.nc @@ -373,7 +373,7 @@ .xn--mgbbh1a71e whois.inregistry.net # India, Urdu AW .xn--mgbc0a9azcg NONE # Morocco .xn--mgberp4a5d4ar whois.nic.net.sa # Saudi Arabia -.xn--mgbx4cd0ab whois.domainregistry.my # Malaysia AW +.xn--mgbx4cd0ab whois.mynic.my # Malaysia AW .xn--o3cw4h whois.thnic.co.th # Thailand .xn--ogbpf8fl whois.tld.sy # Syria .xn--p1ai whois.tcinet.ru # Russian Federation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/version.h new/whois-5.2.0/version.h --- old/whois-5.1.5/version.h 2014-07-25 07:15:00.000000000 +0200 +++ new/whois-5.2.0/version.h 2014-09-13 05:15:04.000000000 +0200 @@ -1 +1 @@ -#define VERSION "5.1.5" +#define VERSION "5.2.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/whois.c new/whois-5.2.0/whois.c --- old/whois-5.1.5/whois.c 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/whois.c 2014-09-13 05:13:19.000000000 +0200 @@ -71,23 +71,61 @@ const char *client_tag = IDSTRING; -#ifdef HAVE_GETOPT_LONG -static const struct option longopts[] = { - {"version", no_argument, NULL, 1 }, - {"verbose", no_argument, NULL, 2 }, - {"help", no_argument, NULL, 3 }, - {"server", required_argument, NULL, 'h'}, - {"host", required_argument, NULL, 'h'}, - {"port", required_argument, NULL, 'p'}, - {NULL, 0, NULL, 0 } -}; -#else +#ifndef HAVE_GETOPT_LONG extern char *optarg; extern int optind; #endif int main(int argc, char *argv[]) { +#ifdef HAVE_GETOPT_LONG + const struct option longopts[] = { + /* program flags */ + {"version", no_argument, NULL, 1 }, + {"verbose", no_argument, NULL, 2 }, + {"help", no_argument, NULL, 3 }, + {"server", required_argument, NULL, 'h'}, + {"host", required_argument, NULL, 'h'}, + {"port", required_argument, NULL, 'p'}, + /* long RIPE flags */ + {"exact", required_argument, NULL, 'x'}, + {"all-more", required_argument, NULL, 'M'}, + {"one-more", required_argument, NULL, 'm'}, + {"all-less", required_argument, NULL, 'L'}, + {"one-less", required_argument, NULL, 'l'}, + {"reverse-domain", required_argument, NULL, 'd'}, + {"irt", required_argument, NULL, 'c'}, + {"abuse-contact", no_argument, NULL, 'b'}, + {"brief", no_argument, NULL, 'F'}, + {"primary-keys", no_argument, NULL, 'K'}, + {"persistent-connection", no_argument, NULL, 'k'}, + {"no-referenced", no_argument, NULL, 'r'}, + {"no-filtering", no_argument, NULL, 'B'}, + {"no-grouping", no_argument, NULL, 'G'}, + {"select-types", no_argument, NULL, 'T'}, + {"all-sources", no_argument, NULL, 'a'}, + {"sources", no_argument, NULL, 's'}, + {"types", no_argument, NULL, 12 }, /* -q */ + {"ripe-version", no_argument, NULL, 12 }, /* -q */ + {"list-sources", no_argument, NULL, 12 }, /* -q */ + {"template", required_argument, NULL, 't'}, + {"ripe-verbose", required_argument, NULL, 'v'}, + /* long RIPE flags with no short equivalent */ + {"list-versions", no_argument, NULL, 10 }, + {"diff-versions", required_argument, NULL, 11 }, + {"show-version", required_argument, NULL, 11 }, + {"resource", no_argument, NULL, 10 }, + {"show-personal", no_argument, NULL, 10 }, + {"no-personal", no_argument, NULL, 10 }, + {"show-tag-info", no_argument, NULL, 10 }, + {"no-tag-info", no_argument, NULL, 10 }, + {"filter-tag-include", required_argument, NULL, 11 }, + {"filter-tag-exclude", required_argument, NULL, 11 }, + {NULL, 0, NULL, 0 } + }; + int longindex; +#endif + int ch, nopar = 0, fstringlen = 64; const char *server = NULL, *port = NULL; char *qstring, *fstring; @@ -106,7 +144,8 @@ argv = merge_args(getenv("WHOIS_OPTIONS"), argv, &argc); while ((ch = GETOPT_LONGISH(argc, argv, - "abBcdFg:Gh:Hi:KlLmMp:q:rRs:t:T:v:V:x", longopts, 0)) > 0) { + "abBcdFg:Gh:Hi:KlLmMp:q:rRs:t:T:v:V:x", + longopts, &longindex)) > 0) { /* RIPE flags */ if (strchr(ripeflags, ch)) { if (strlen(fstring) + 3 > fstringlen) { @@ -127,8 +166,37 @@ nopar = 1; continue; } - /* program flags */ switch (ch) { +#ifdef HAVE_GETOPT_LONG + /* long RIPE flags with no short equivalent */ + case 12: + nopar = 1; + /* fall through */ + case 10: + { + int flaglen = 2 + strlen(longopts[longindex].name) + 1; + if (strlen(fstring) + flaglen > fstringlen) { + fstringlen += flaglen; + fstring = realloc(fstring, fstringlen + 1); + } + sprintf(fstring + strlen(fstring), "--%s ", + longopts[longindex].name); + } + break; + case 11: + { + int flaglen = 2 + strlen(longopts[longindex].name) + 1 + + strlen(optarg) + 1; + if (strlen(fstring) + flaglen > fstringlen) { + fstringlen += flaglen; + fstring = realloc(fstring, fstringlen + 1); + } + sprintf(fstring + strlen(fstring), "--%s %s ", + longopts[longindex].name, optarg); + } + break; +#endif + /* program flags */ case 'h': server = strdup(optarg); break; @@ -187,8 +255,8 @@ if (getenv("WHOIS_HIDE")) hide_discl = HIDE_NOT_STARTED; - /* -v or -t has been used */ - if (!server && !*qstring) + /* -v or -t or long flags have been used */ + if (!server && (!*qstring || *fstring)) server = strdup("whois.ripe.net"); if (*qstring) { @@ -392,7 +460,7 @@ { unsigned long ip, as32; unsigned int i; - const char *colon; + const char *colon, *tld; /* IPv6 address */ if ((colon = strchr(s, ':'))) { @@ -460,16 +528,9 @@ return strdup(tld_serv[i + 1]); /* use the default server name for "new" gTLDs */ - if (is_new_gtld(s)) { - char *server; - const char *p, *tld = NULL; - - for (p = s; *p; p++) /* look for the TLD */ - if (*p == '.') - tld = p; - - server = malloc(strlen("whois.nic") + strlen(tld) + 1); - strcpy(server, "whois.nic"); + if ((tld = is_new_gtld(s))) { + char *server = malloc(strlen("whois.nic.") + strlen(tld) + 1); + strcpy(server, "whois.nic."); strcat(server, tld); return(server); } @@ -779,6 +840,8 @@ free(temp); while (fgets(buf, sizeof(buf), fi)) { + /* If multiple attributes are returned then use the first result. + This is not supposed to happen. */ if (state == 0 && strneq(buf, "Domain Name:", 12)) state = 1; if (state == 1 && strneq(buf, "Whois Server:", 13)) { @@ -787,8 +850,11 @@ referral_server = strdup(p); if ((p = strpbrk(referral_server, "\r\n "))) *p = '\0'; + state = 2; } + /* the output must not be hidden or no data will be shown for + host records and not-existing domains */ if (hide_line(&hide, buf)) continue; @@ -983,13 +1049,13 @@ return 0; } -int is_new_gtld(const char *s) +const char *is_new_gtld(const char *s) { int i; for (i = 0; new_gtlds[i]; i++) if (domcmp(s, new_gtlds[i])) - return 1; + return new_gtlds[i] + 1; return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.1.5/whois.h new/whois-5.2.0/whois.h --- old/whois-5.1.5/whois.h 2014-08-02 03:31:54.000000000 +0200 +++ new/whois-5.2.0/whois.h 2014-09-13 02:42:29.000000000 +0200 @@ -29,7 +29,7 @@ unsigned long asn32_to_long(const char *); int isasciidigit(const char); int domcmp(const char *, const char *); -int is_new_gtld(const char *); +const char *is_new_gtld(const char *); int domfind(const char *, const char *[]); char *normalize_domain(const char *); char *convert_6to4(const char *); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org