Matthew Booth
2013-Jun-07 11:18 UTC
[Libguestfs] [PATCH] inspect: Fix bogus warning for partitions without /boot.ini
Fix a bogus warning introduced by 5abb196de869cd27a6fa2377d79b9a267120f48e. If a non-windows partition hasn't been detected as something else and falls through to windows detection, inspection would display a bogus warning about missing /boot.ini. --- src/inspect-fs-windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c index 4eea6a3..c67f164 100644 --- a/src/inspect-fs-windows.c +++ b/src/inspect-fs-windows.c @@ -154,7 +154,7 @@ guestfs___get_windows_systemroot (guestfs_h *g) * systemroot locations */ CLEANUP_FREE char *boot_ini_path guestfs___case_sensitive_path_silently (g, "/boot.ini"); - if (boot_ini_path) { + if (boot_ini_path && guestfs_is_file (g, boot_ini_path)) { CLEANUP_FREE_STRING_LIST char **boot_ini guestfs_read_lines (g, boot_ini_path); if (!boot_ini) { -- 1.8.2.1
Richard W.M. Jones
2013-Jun-07 11:21 UTC
Re: [Libguestfs] [PATCH] inspect: Fix bogus warning for partitions without /boot.ini
On Fri, Jun 07, 2013 at 12:18:51PM +0100, Matthew Booth wrote:> Fix a bogus warning introduced by > 5abb196de869cd27a6fa2377d79b9a267120f48e. If a non-windows partition > hasn't been detected as something else and falls through to windows > detection, inspection would display a bogus warning about missing > /boot.ini. > --- > src/inspect-fs-windows.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c > index 4eea6a3..c67f164 100644 > --- a/src/inspect-fs-windows.c > +++ b/src/inspect-fs-windows.c > @@ -154,7 +154,7 @@ guestfs___get_windows_systemroot (guestfs_h *g) > * systemroot locations */ > CLEANUP_FREE char *boot_ini_path > guestfs___case_sensitive_path_silently (g, "/boot.ini"); > - if (boot_ini_path) { > + if (boot_ini_path && guestfs_is_file (g, boot_ini_path)) { > CLEANUP_FREE_STRING_LIST char **boot_ini > guestfs_read_lines (g, boot_ini_path); > if (!boot_ini) {Thanks. I pushed it, but I changed the test to guestfs_is_file > 0. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Reasonably Related Threads
- [PATCH 3/3] inspect: Partial support for non-standard windows system root
- [PATCH 1/3] inspection: Refactor windows systemroot detection to allow re-use
- [PATCH] daemon: simplify usage of Chroot.f
- [PATCH v11 09/10] daemon: Implement inspection of Windows.
- [PATCH] inspector: add ReactOS systemroot