Mykola Ivanets 7b4d13626f daemon: inspect: better handling windows drive mapping.
I saw several Windows disk images which contains strange registry entry
for mapped drives:

"\\DosDevices\\Y:"=hex(3):00,00,00,00,00,00,00,00,00,00,00,00

Which is decoded something like diskID = 0x0, partition starts at 0
bytes offset from the start of the disk.  In addition to a Windows disk
image, I have attached dummy disk and made xfs file system on a whole
device without partitioning it.  I mount xfs file system to a "/" and
then mkdir and mount other found file systems inside (/fs1, /fs2 etc.).

When we decode drive mappings we are looking for a disk with ID 0x0 (it
is 4 bytes somewhere LBA0).  It is appeared that dummy non-partitioned
disk with xfs file system has zeros by offset where diskID is expected
to be).  So the disk is considered as a candidate to search for
partition at offset 0. part-list command (and "parted" which is used
under the hood) reports there is 1 partition on "dummy" disk which
starts exactly at offset 0.  And thus dummy device name and partition
number are simply concatenated together and corresponding drive mapping
is returned: Y => /dev/sdX1.  But /dev/sdX1 is not existing block
device.

No matter either it is a bug in "parted" (or it works this way
by-design), let's protect ourself from this situation: in addition we
look for msdos partition table on a disk before making any further
assumptions.
2018-06-01 15:09:34 +01:00
2018-01-04 15:30:10 +00:00
2018-02-12 11:24:06 +01:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-02-07 18:38:13 +00:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-05-06 23:35:50 +02:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-05-21 13:09:53 +01:00
2018-05-21 13:09:53 +01:00
2018-01-04 15:30:10 +00:00
2018-04-19 11:30:29 +02:00
2018-01-04 15:30:10 +00:00
2018-02-22 15:06:13 +00:00
2018-01-04 15:30:10 +00:00
2018-05-21 13:09:53 +01:00
2017-01-26 15:05:46 +00:00
2018-05-21 13:09:53 +01:00
2018-01-04 15:30:10 +00:00
2018-01-04 15:30:10 +00:00
2018-05-21 13:09:53 +01:00
2018-01-04 15:30:10 +00:00
2016-02-10 14:15:05 +01:00

Libguestfs is tools and a library for accessing and modifying guest
disk images.  For more information see the home page:

  http://libguestfs.org/

For discussion, development, patches, etc. please use the mailing
list:

  http://www.redhat.com/mailman/listinfo/libguestfs

To find out how to build libguestfs from source, read:

  docs/guestfs-building.pod
  http://libguestfs.org/guestfs-building.1.html
  man docs/guestfs-building.1

Copyright (C) 2009-2018 Red Hat Inc.

The library is distributed under the LGPLv2+.  The programs are
distributed under the GPLv2+.  Please see the files COPYING and
COPYING.LIB for full license information.  The examples are under a
very liberal license.
Languages
C 42.7%
OCaml 35.5%
Shell 7.1%
Makefile 4%
Perl 2.6%
Other 8%