Coverity: Don't close fd_cwd if fd_cwd == -1.
[libguestfs.git] / src / inspect.c
index 900b6f4..e7408b6 100644 (file)
@@ -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;
@@ -2003,11 +2003,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;