Debian Bug report logs - #542148
jwhois: connection failures

version graph

Package: jwhois; Maintainer for jwhois is Paul Dwerryhouse <>; Source for jwhois is src:jwhois.

Reported by: Alan Curry <>

Date: Tue, 18 Aug 2009 04:45:04 UTC

Severity: normal

Tags: patch

Found in version jwhois/4.0-1

Fixed in version jwhois/4.0-2

Done: Paul Dwerryhouse <>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to, Paul Dwerryhouse <>:
Bug#542148; Package jwhois. (Tue, 18 Aug 2009 04:45:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Curry <>:
New Bug report received and forwarded. Copy sent to Paul Dwerryhouse <>. (Tue, 18 Aug 2009 04:45:07 GMT) Full text and rfc822 format available.

Message #5 received at (full text, mbox):

From: Alan Curry <>
To: Debian Bug Tracking System <>
Subject: jwhois: connection failures
Date: Mon, 17 Aug 2009 23:44:13 -0500
Package: jwhois
Version: 4.0-1
Severity: normal
Tags: patch

With the current version of jwhois, I can't do IP address lookups. It fails
to connect to,, and These
lookups used to work with some older version (I'm not sure which).

The problem is in make_connect() in utils.c, the part that loops over the
list of results obtained from lookup_host_addrinfo(). After attempting to
make a connection, it does this:

      error = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &retval, &retlen);
      if (error < 0 || retval)

The intent was apparently to break out of the loop when a successful
connection occurs, but the retval test does the opposite, breaking out when a
connection fails.

With for example, there are 2 IPv4 addresses and an IPv6
address. This loop connects to the first address successfully, so the
getsockopt results in error=0 retval=0, so it doesn't break. The next time
through the loop, it connects to the second address successfully, and doesn't
break. The third time, it fails to connect to the third address, because I
don't have IPv6. Now the loop ends and the function returns -1, failed to
connect, and the results look like this:

$ whois
[Error creating socket]
[Unable to connect to remote host]

(Horrible error reporting, no strerror(errno) in it anywhere)

This patch gets it working again.

--- src/utils.c	2007-06-26 02:00:20.000000000 -0500
+++ src/utils.c	2009-08-17 23:35:09.000000000 -0500
@@ -288,7 +288,7 @@
       retlen = sizeof(retval);
       error = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &retval, &retlen);
-      if (error < 0 || retval)
+      if (error < 0 || !retval)

-- Syster Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: powerpc (ppc)

Kernel: Linux
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages jwhois depends on:
ii  adduser                       3.110      add and remove users and groups
ii  dpkg                          1.14.25    Debian package management system
ii  libc6                         2.7-18     GNU C Library: Shared libraries
ii  libgdbm3                      1.8.3-3    GNU dbm database routines (runtime

Versions of packages jwhois recommends:
pn  lynx                          <none>     (no description available)

jwhois suggests no packages.

-- no debconf information

Reply sent to Paul Dwerryhouse <>:
You have taken responsibility. (Tue, 23 Nov 2010 22:51:12 GMT) Full text and rfc822 format available.

Notification sent to Alan Curry <>:
Bug acknowledged by developer. (Tue, 23 Nov 2010 22:51:12 GMT) Full text and rfc822 format available.

Message #10 received at (full text, mbox):

From: Paul Dwerryhouse <>
Subject: Bug#542148: fixed in jwhois 4.0-2
Date: Tue, 23 Nov 2010 22:48:10 +0000
Source: jwhois
Source-Version: 4.0-2

We believe that the bug you reported is fixed in the latest version of
jwhois, which is due to be installed in the Debian FTP archive:

  to main/j/jwhois/jwhois_4.0-2.diff.gz
  to main/j/jwhois/jwhois_4.0-2.dsc
  to main/j/jwhois/jwhois_4.0-2_powerpc.deb

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Paul Dwerryhouse <> (supplier of updated jwhois package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing

Hash: SHA256

Format: 1.8
Date: Tue, 16 Mar 2010 11:41:02 -0700
Source: jwhois
Binary: jwhois
Architecture: source powerpc
Version: 4.0-2
Distribution: unstable
Urgency: low
Maintainer: Paul Dwerryhouse <>
Changed-By: Paul Dwerryhouse <>
 jwhois     - Improved Caching Whois client
Closes: 236317 321848 410327 542148
 jwhois (4.0-2) unstable; urgency=low
   * Updated to latest Debian standards
   * version 4.0 fixes timeout issue (Closes: #410327)
   * version 4.0 supports IDN (Closes: #236317)
   * package builds fine from source (Closes: #321848)
   * Alan Curry's retval patch (Closes: #542148)
   * added set -e to postinst and postrm
 65e1c115bf92df114929f30207189ed89bbcbc1b 1669 jwhois_4.0-2.dsc
 27eadc0eedebaa1c903782e00c3af2ecb7d9fb64 8032 jwhois_4.0-2.diff.gz
 55eda73bc0ff4242f2dc8c8ac1b1ed5c535932d3 96194 jwhois_4.0-2_powerpc.deb
 550db4a3d0c0faf9229e8b75d96e388ca497de46e76c85b13a8fe3ddf3d6d15a 1669 jwhois_4.0-2.dsc
 f67e9ed238bf34ad039444f4e29741638f3082b5218c73deaf4919a2b3e08a37 8032 jwhois_4.0-2.diff.gz
 867a5dcd28e3b0ff02d57b211e01320570bdf3c04770b3afb2ca36ddefc1f0d9 96194 jwhois_4.0-2_powerpc.deb
 1848c4f05dc293c0e725b1916f9f87ac 1669 net optional jwhois_4.0-2.dsc
 4706498df3c2e90ccebe17870a7eeab2 8032 net optional jwhois_4.0-2.diff.gz
 4a7f1cadd0110a67ff32498bf8548d36 96194 net optional jwhois_4.0-2_powerpc.deb

Version: GnuPG v1.4.10 (GNU/Linux)


Bug archived. Request was from Debbugs Internal Request <> to (Mon, 07 Mar 2011 09:03:39 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.

Debian bug tracking system administrator <>. Last modified: Wed Apr 16 16:28:02 2014; Machine Name:

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.