Re: Unix platforms shouldn't mask errors specific to Unix domain sockets

Wan-Teh Chang <[email protected]> Tue, 20 Aug 2013 18:37:55 -0700
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <CALTJjxFJ=mkJMbRRZpeRaQ=B-Kou6ysRYGUzLNsiQmoK4-4hkw@mail.gmail.com>
On Tue, Aug 20, 2013 at 6:09 PM, Jim Blandy <[email protected]> wrote:
>
> The patch actually deletes all the switch cases in
> _MD_unix_map_connect_error that map errno values to
> PR_ADDRESS_NOT_SUPPORTED_ERROR. Deleting those cases has the effect of
> delegating those values to _MD_unix_map_default_error, which does map
> EACCES to PR_NO_ACCESS_RIGHTS_ERROR, as you suggest.
>
> The errors this affects are those that arise only when using Unix-domain
> sockets --- with the exception (that I know of) of EACCES, which Linux
> will return for IP and IPv6 addresses if firewall rules forbid the
> connection. Even there, I think PR_NO_ACCESS_RIGHTS_ERROR would be the
> more informative status to return.

Thank you for the patch. I filed an NSPR bug
(https://bugzilla.mozilla.org/show_bug.cgi?id=907512) and checked in
your patch to the NSPR hg repository.

> If there are NSPR clients out there that are checking for
> PR_ADDRESS_NOT_SUPPORTED_ERROR while using Unix-domain sockets, they're
> not going be doing very sophisticated error recovery based on those
> codes. If I've thought this through right, then although the patch is
> not a backwards-compatible change, it is one that will probably have
> little effect beyond improving error messages.

I agree.

Wan-Teh