7 Commits

Author SHA1 Message Date
Richard W.M. Jones
72cfaff5c5 Update copyright dates for 2025
Automated using this command:

perl -pi.bak -e 's/(20[012][0-9])-20[12][01234]/$1-2025/g' `git ls-files`
2025-02-16 17:00:46 +00:00
Richard W.M. Jones
250ee85839 Rework Std_utils.Option so it works like the OCaml stdlib module
OCaml 4.08 introduces a stdlib Option module which looks a bit like
ours but has a number of differences.  In particular our functions
Option.may and Option.default have no corresponding functions in
stdlib, although there are close enough equivalents.

This change was automated using this command:

$ perl -pi.bak \
  -e 's/Option.may/Option.iter/g; s/Option.default /Option.value ~default:/g' \
  `git ls-files`

Update common module to include:

  commit cffa077323fafcdfcf78e230c022afa891a6b3ff
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Mon Feb 20 12:11:51 2023 +0000

    mlstdutils: Rework the Option module to be compatible with stdlib
2023-02-20 12:14:08 +00:00
Richard W.M. Jones
e2c7bddf10 Update copyright dates for 2023
Run this command across the source:

  perl -pi.bak -e 's/(20[012][0-9])-20[12][012]/$1-2023/g' `git ls-files`

and remove changes to po{,-docs}/*.po{,t} (these will be regenerated
later when we run 'make dist').
2023-02-07 10:50:48 +00:00
Richard W.M. Jones
51d21f7684 daemon: Fix isoinfo on files
Commit 2f587bbaec ("daemon: Read ISO9660 Primary Volume Descriptor
directly.") changed daemon/isoinfo.ml to read the PVD directly.  This
was fine for guestfs_isoinfo_device which opens a device name, but did
not work for ISOs embedded within filesystems opened using
guestfs_isoinfo because we did not chroot into the filesystem first.

Example reproducer (run from the libguestfs source directory):

$ guestfish -N fs -m /dev/sda1 upload ./test-data/test.iso /test.iso
$ guestfish --ro -a test1.img -m /dev/sda1 isoinfo /test.iso
libguestfs: error: isoinfo: open: /test.iso: No such file or directory

After this fix:

$ guestfish --ro -a test1.img -m /dev/sda1 isoinfo /test.iso
iso_system_id:
iso_volume_id: ISOIMAGE
iso_volume_space_size: 2490
[etc.]

Reported-by: Yongkui Guo
Fixes: commit 2f587bbaec
Fixes: https://bugzilla.redhat.com/show_bug.cgi
2021-05-13 09:19:31 +01:00
Richard W.M. Jones
e94d2345bc daemon/isoinfo.ml: Fix offset of Abstract File Identifier
https://listman.redhat.com/archives/libguestfs/2021-April/msg00058.html

Thanks: Thomas Schmitt
2021-04-17 19:00:26 +01:00
Richard W.M. Jones
2f587bbaec daemon: Read ISO9660 Primary Volume Descriptor directly.
It turns out we can read the information we need for the isoinfo API
directly from the ISO9660 PVD.  We don't need to use either isoinfo or
xorriso.  This also has the advantages of reducing by 1 the number of
dependencies in the appliance, and reducing potential vulnerability to
a crafted ISO file.

This also fixes timezone calculation for the datetime fields.

Thanks: Thomas Schmitt
Updates: commit efb8a766ca
2021-03-31 11:35:32 +01:00
Richard W.M. Jones
efb8a766ca daemon: Allow xorriso as an alternative to isoinfo.
Currently the guestfs_isoinfo and guestfs_isoinfo_device APIs run
isoinfo inside the appliance to extract the information.

isoinfo is part of genisoimage which is somewhat dead upstream.
xorriso is supposedly the new thing.  (For a summary of the situation
see: https://wiki.debian.org/genisoimage).

This commit rewrites the parsing from C to OCaml to make it easier to
deal with, and allows you to use either isoinfo or xorriso.

Mostly the same fields are available from either tool, but xorriso is
a bit more awkward to parse.
2021-03-30 15:21:54 +01:00