Closed
Bug 394013
Opened 17 years ago
Closed 17 years ago
vfyserv hostname lookup failure
Categories
(NSS :: Tools, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.12
People
(Reporter: KaiE, Assigned: KaiE)
Details
Attachments
(1 file, 1 obsolete file)
783 bytes,
patch
|
nelson
:
review+
rrelyea
:
superreview+
|
Details | Diff | Splinter Review |
I'm on Linux and I tried the vfyserv utility, both from 3.11.x and pre-3.12 This simple execution produces a failure: $ vfyserv paypal.com Error in function PR_GetHostByName: -5973 - A directory lookup on a network address has failed. Bob R was able to reproduce this failure. Using "host paypal.com" works fine. Running "vfyserv ip-address-of-paypal.com" is not really a good workaround, because it complains about hostname mismatch (of course).
Comment 1•17 years ago
|
||
May be an NSPR bug on Linux? Maybe a Linux bug? Kai, Since you run Linux and I don't, let me ask you to delve into this with a debugger. Bug 366614 will change vfyserv to use an IPv6-capable replacement for PR_GetHostByName soon. So, if this is a bug in PR_GetHostByName, we should identify that (and turn this into an NSPR bug) ASAP, before bug 366614 is fixed.
Updated•17 years ago
|
Version: trunk → 3.11
Comment 2•17 years ago
|
||
I had the same failure on my windows box.
Assignee | ||
Comment 3•17 years ago
|
||
Sigh. Maybe it should have taken me less time to find out, but after an hour of debugging, the answer is: gethostbyname_r returns: ERANGE 34 /* Math result not representable */ vfyserv uses a 256 bytes buffer when calling PR_GetHostByName. This seems to be too small. I will attach a patch to increase that buffer and make it work for me... I have also filed bug 394375 where I propose that NSPR should set a better error code.
Assignee | ||
Comment 4•17 years ago
|
||
Attachment #279023 -
Flags: review?(nelson)
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → kengert
OS: Linux → All
Hardware: PC → All
Comment 5•17 years ago
|
||
Comment on attachment 279023 [details] [diff] [review] Patch v1 I'm baffled. This program has always worked for me! Never any DNS lookup error. I'm not THAT special. :) So, why does it work for me and fail for you? r=nelson. I request one slight change: >- prStatus = PR_GetHostByName(hostName, buffer, 256, &hostEntry); >+ prStatus = PR_GetHostByName(hostName, buffer, 1024, &hostEntry); Please change that to: >+ prStatus = PR_GetHostByName(hostName, buffer, sizeof buffer, &hostEntry); So that we don't have to change this line again if we change the size of buffer.
Attachment #279023 -
Flags: review?(nelson) → review+
Assignee | ||
Comment 6•17 years ago
|
||
Actually there is an even better patch. There is a constant that can be used for the size of the buffer. Actually, there is another occurrence of that in the same source file which makes already use of that constant!!! So here is a better patch, which uses the constant and the sizeof(buffer).
Attachment #279023 -
Attachment is obsolete: true
Attachment #279025 -
Flags: review?(nelson)
Comment 7•17 years ago
|
||
Comment on attachment 279025 [details] [diff] [review] Patch v2 This is good. >- prStatus = PR_GetHostByName(hostName, buffer, 256, &hostEntry); >+ prStatus = PR_GetHostByName(hostName, buffer, sizeof(buffer), &hostEntry); Note that the parentheses around buffer are unnecessary. Parentheses are required only if the argument to sizeof is a type name, not if it is an expression. But it's OK this way.
Attachment #279025 -
Flags: review?(nelson) → review+
Assignee | ||
Comment 8•17 years ago
|
||
Comment on attachment 279025 [details] [diff] [review] Patch v2 I propose to land on 3.11 branch, too, requesting 2nd review.
Attachment #279025 -
Flags: superreview?(rrelyea)
Assignee | ||
Comment 9•17 years ago
|
||
trunk: /cvsroot/mozilla/security/nss/cmd/vfyserv/vfyserv.c,v <-- vfyserv.c new revision: 1.15; previous revision: 1.14
Comment 10•17 years ago
|
||
Comment on attachment 279025 [details] [diff] [review] Patch v2 r+ rrelyea. yes, much better then the original code.
Attachment #279025 -
Flags: superreview?(rrelyea) → superreview+
Assignee | ||
Comment 11•17 years ago
|
||
3.11 branch: /cvsroot/mozilla/security/nss/cmd/vfyserv/vfyserv.c,v <-- vfyserv.c new revision: 1.11.2.4; previous revision: 1.11.2.3 marking fixed
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 12•17 years ago
|
||
This wasn't failing on Solaris either, FYI.
Updated•16 years ago
|
Priority: -- → P2
Target Milestone: --- → 3.12
You need to log in
before you can comment on or make changes to this bug.
Description
•