After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 336391 - Possible error in EAI_ADDRFAMILY handling
Possible error in EAI_ADDRFAMILY handling
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Other
cvs (head)
Other NetBSD
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-28 19:50 UTC by Julio Merino
Modified: 2006-07-13 17:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (1.30 KB, patch)
2006-03-28 19:51 UTC, Julio Merino
committed Details | Review

Description Julio Merino 2006-03-28 19:50:47 UTC
The libgnomevfs/gnome-vfs-resolve.c has a switch case in the _gnome_vfs_result_from_gai_error that converts the given error number to an appropriate gnome-vfs error code.  However, there is a little problem when handling EAI_ADDRFAMILY, hidden by the #ifdef "pollution".

Consider a system that has EAI_ADDRFAMILY but lacks EAI_NODATA.  In that situation, the EAI_ADDRFAMILY case will fall through EAI_SYSTEM, returning a non-sense value.  Or, e.g. if EAI_SYSTEM is not available, then the code will fall through to EAI_AGAIN, returning that there was a name server error.  Similarly, if EAI_NODATA is available, the code will return that there is no address (or whatever the error means, I do not know exactly).

Summarizing: given that many entries of that switch construction are conditionally built, EAI_ADDRFAMILY should explicitly return its appropriate error value so that it does not depend on the other macros being defined.

If I understood it correctly, an EAI_ADDRFAMILY error should be converted to GNOME_VFS_ERROR_HOST_HAS_NO_ADDRESS.  If so, this is what the attached patch does.
Comment 1 Julio Merino 2006-03-28 19:51:24 UTC
Created attachment 62239 [details] [review]
Proposed patch.
Comment 2 Christian Kellner 2006-07-13 17:52:00 UTC
Thanks for the patch. Patch is committed to cvs HEAD.