X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Finspect.c;h=ec1a2a0b3d753d25549ecb0f8197f077a6045605;hb=4a0d836d5b2b1f32a7ccf0f32c9e532816acfac2;hp=900b6f41970046a77b31dda3d866929fe79c3b1f;hpb=57261c712d7012e858f93d040938750866bd6ae0;p=libguestfs.git diff --git a/src/inspect.c b/src/inspect.c index 900b6f4..ec1a2a0 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -360,9 +360,9 @@ check_filesystem (guestfs_h *g, const char *device) * would *not* be Windows root disks. (RHBZ#674130) */ else if (is_file_nocase (g, "/AUTOEXEC.BAT") > 0 || - is_dir_nocase (g, "/WINDOWS") > 0 || - is_dir_nocase (g, "/WIN32") > 0 || - is_dir_nocase (g, "/WINNT") > 0 || + is_dir_nocase (g, "/WINDOWS/SYSTEM32") > 0 || + is_dir_nocase (g, "/WIN32/SYSTEM32") > 0 || + is_dir_nocase (g, "/WINNT/SYSTEM32") > 0 || is_file_nocase (g, "/boot.ini") > 0 || is_file_nocase (g, "/ntldr") > 0) { fs->is_root = 1; @@ -757,11 +757,18 @@ check_hostname_redhat (guestfs_h *g, struct inspect_fs *fs) { char *hostname; + /* Errors here are not fatal (RHBZ#726739), since it could be + * just missing HOSTNAME field in the file. + */ + guestfs_error_handler_cb old_error_cb = g->error_cb; + g->error_cb = NULL; hostname = guestfs_aug_get (g, "/files/etc/sysconfig/network/HOSTNAME"); - if (!hostname) - return -1; + g->error_cb = old_error_cb; - fs->hostname = hostname; /* freed by guestfs___free_inspect_info */ + /* This is freed by guestfs___free_inspect_info. Note that hostname + * could be NULL because we ignored errors above. + */ + fs->hostname = hostname; return 0; } @@ -2003,11 +2010,11 @@ list_applications_windows (guestfs_h *g, struct inspect_fs *fs) fs->windows_systemroot); char *software_path = case_sensitive_path_silently (g, software); - if (!software_path) - /* If the software hive doesn't exist, just accept that we cannot - * find product_name etc. - */ - return 0; + if (!software_path) { + /* Missing software hive is a problem. */ + error (g, "no HKLM\\SOFTWARE hive found in the guest"); + return NULL; + } struct guestfs_application_list *apps = NULL, *ret = NULL; hive_h *h = NULL;