Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158140 - net-misc/whois improperly decides IP vs name
Summary: net-misc/whois improperly decides IP vs name
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-14 07:02 UTC by sullo
Modified: 2007-09-29 13:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
whois-catch-invalid-ips.patch (whois-catch-invalid-ips.patch,320 bytes, patch)
2006-12-15 22:24 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sullo 2006-12-14 07:02:37 UTC
whois version 4.7.12 (ebuild version) improperly determines which whois server/type to use when looking up domain names.

Try this:
whois 192.168.112.2o6.net

The improper answer from whois is that this an ARIN restricted net block--but it's not, it's actually 2o6.net, which is a valid domain name. 

The match in whois appears to be a regex match against ip_del_list, which is not proper in this case, as there is more name information after the "192.168.112.2" bit of the name.  The same is true for for any "ip looking" name.

whois (various versions) displays the same behavior on debian and red hat. whois on Mac OS X properly reports that the domain name is not found (as it should--2o6.net is the proper name).
Comment 1 SpanKY gentoo-dev 2006-12-15 22:19:45 UTC
well, that is an invalid hostname ... you cannot have numeric-only portions

the bug is in the myinet_aton() function ... if the string begins with #.#.#.#, then it's assumed to be an IP address since it's an invalid hostname otherwise
Comment 2 SpanKY gentoo-dev 2006-12-15 22:24:00 UTC
Created attachment 104113 [details, diff]
whois-catch-invalid-ips.patch
Comment 3 sullo 2006-12-15 23:57:22 UTC
SpanKY, 

the patch you provided works fine on my Mac OS X system using whois compiled from source.

I agree that it was an invalid name to look up, and realized it as i hit enter, and was dumbfounded when it reported it back as an ARIN netblock... 

maybe trips up two people a  year, but hopefully fewer now. thanks for patching something in so quikly!  How long does it take from here to make it into the normal distro trees?

Regards,
Sullo
Comment 4 SpanKY gentoo-dev 2006-12-16 00:16:00 UTC
i mailed the patch upstream so i'll see how he responds
Comment 5 SpanKY gentoo-dev 2007-09-29 13:51:04 UTC
4.7.23 should work