[Libguestfs] failure to find hostname causing fatal error

Todd Mummert toddmummert at gmail.com
Tue May 22 03:00:12 UTC 2012


Trying to inspect an old OpenSuSE image, which has an empty
/etc/HOSTNAME file.   This causes check_hostname_unix() in
inspect_fs_unix() to return -1 -- causing inspection to fail.
Somewhat interestingly, if no files of interest were found, the
function would return 0.....which I think doesn't cause problems
upstream.

It's somewhat related to this closed bug where the fix was to set the
return code to 0 and hostname could end up null.

https://bugzilla.redhat.com/show_bug.cgi?id=726739


It may be correct, in fact, to try each of the hostname checks until 1
succeeds or they all fail, and then return 0 in all cases.

--Todd




More information about the Libguestfs mailing list