Re: [Libguestfs] regression: file does not understand the -S option

2023-09-21 Thread Laszlo Ersek
On 9/20/23 23:42, Olaf Hering wrote: > Recently a commit was added to call 'file -zSb' instead of 'file -zb'. > > This causes a regression on Leap 15 (but not on Tumbleweed), because > file 5.32 does not understand the -S option. > > How can this be fixed properly, to handle both cases either at

Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-21 Thread Divyanshu Kumar
Hi @Richard W.M. Jones, I am attaching a sample program of how we are using guestfs apis where we are getting this error guestfs_mount_local fail. Please take a look into this. Thanks, Divyanshu -Original Message- From: Richard W.M. Jones Sent: Tuesday, September 19, 2023 5:36 PM To:

Re: [Libguestfs] regression: file does not understand the -S option

2023-09-21 Thread Richard W.M. Jones
On Wed, Sep 20, 2023 at 11:42:55PM +0200, Olaf Hering wrote: > Recently a commit was added to call 'file -zSb' instead of 'file -zb'. > > This causes a regression on Leap 15 (but not on Tumbleweed), because > file 5.32 does not understand the -S option. > > How can this be fixed properly, to hand

Re: [Libguestfs] regression: file does not understand the -S option

2023-09-21 Thread Daniel P . Berrangé
On Thu, Sep 21, 2023 at 12:25:21PM +0100, Richard W.M. Jones wrote: > On Wed, Sep 20, 2023 at 11:42:55PM +0200, Olaf Hering wrote: > > Recently a commit was added to call 'file -zSb' instead of 'file -zb'. > > > > This causes a regression on Leap 15 (but not on Tumbleweed), because > > file 5.32 d

[Libguestfs] [PATCH libguestfs] daemon: Omit 'file -S' option on older distros that lack support

2023-09-21 Thread Richard W.M. Jones
OpenSUSE LEAP 15 lacks support for this option, so test for it before using it. See-also: https://listman.redhat.com/archives/libguestfs/2023-September/032613.html Report-by: Olaf Hering Fixes: commit 23986d3c4f4d1f9cbac44cc743d3e6af721e4237 --- daemon/Makefile.am | 2 ++ daemon/file.ml

Re: [Libguestfs] [PATCH libguestfs] daemon: Omit 'file -S' option on older distros that lack support

2023-09-21 Thread Laszlo Ersek
On 9/21/23 13:42, Richard W.M. Jones wrote: > OpenSUSE LEAP 15 lacks support for this option, so test for it before > using it. > > See-also: > https://listman.redhat.com/archives/libguestfs/2023-September/032613.html > Report-by: Olaf Hering > Fixes: commit 23986d3c4f4d1f9cbac44cc743d3e6af721e42

Re: [Libguestfs] [PATCH libguestfs] daemon: Omit 'file -S' option on older distros that lack support

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 03:56:05PM +0200, Laszlo Ersek wrote: ... > > +open Std_utils > > + > > +(* Does [file] support the [-S] / [--no-sandbox] option > > + * (not on OpenSUSE LEAP 15). > > + *) > > +let file_has_S_option = lazy ( > > + let out = Utils.command "file" ["file"; "--help"] in > > I

Re: [Libguestfs] [PATCH libguestfs] daemon: Omit 'file -S' option on older distros that lack support

2023-09-21 Thread Richard W.M. Jones
This is upstream in c95d8c4cf64142. Also added a few commits to fix the Ruby tests which had broken because of a recent change to Ruby. I'll cut a development release soon. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualiza

Re: [Libguestfs] regression: file does not understand the -S option

2023-09-21 Thread Olaf Hering
Thu, 21 Sep 2023 10:21:41 +0200 Laszlo Ersek : > Does your error output contain > file: invalid option -- 'S' > ? Yes, it looks like this: # /usr/bin/env -i /usr/bin/file -S /usr/bin/file: invalid option -- 'S' Usage: file [-bcEhikLlNnprsvzZ0] [--apple] [--extension] [--mime-encoding] [--mime-

Re: [Libguestfs] Fwd: virt-v2v creating image that does not install guest agent on first boot

2023-09-21 Thread Lee Garrett
After testing it again today, the guest agent is still not installed, however this time the C:\Program Files\Guestfs\Firstboot\log.txt exists: starting firstboot service running "C:\Program Files\Guestfs\Firstboot\scripts\5000-0001-wait-pnp.bat" 1 file(s) moved. Wait for PnP to complete

[Libguestfs] Some comments on the libnbd apk in Alpine

2023-09-21 Thread Richard W.M. Jones
Hi Sean, the maintainers of libnbd here. Thanks for packaging libnbd in Alpine: https://git.alpinelinux.org/aports/tree/testing/libnbd/APKBUILD I have a few comments: (1) The url field should be "https://gitlab.com/nbdkit/libnbd"; (The one you are using is an old, stale mirror) (2) libxml2-dev

Re: [Libguestfs] [External] Re: [PATCH] VxFS Filesystem support to libguestfs

2023-09-21 Thread Ravi Singh
Hi Richard, Thank you for making these changes. We appreciate your insights. We will promptly address the issues you have mentioned, thoroughly test them. We will keep you updated and send you the patch once we have completed the testing. Thanks, Ravi/Gaurang F

Re: [Libguestfs] Fwd: virt-v2v creating image that does not install guest agent on first boot

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 04:50:26PM +0200, Lee Garrett wrote: > After testing it again today, the guest agent is still not > installed, however this time the C:\Program > Files\Guestfs\Firstboot\log.txt exists: > > starting firstboot service > running "C:\Program Files\Guestfs\Firstboot\scripts\500

Re: [Libguestfs] Fwd: virt-v2v creating image that does not install guest agent on first boot

2023-09-21 Thread Lee Garrett
On 21.09.23 18:08, Richard W.M. Jones wrote: On Thu, Sep 21, 2023 at 04:50:26PM +0200, Lee Garrett wrote: After testing it again today, the guest agent is still not installed, however this time the C:\Program Files\Guestfs\Firstboot\log.txt exists: starting firstboot service running "C:\Program

Re: [Libguestfs] Fwd: virt-v2v creating image that does not install guest agent on first boot

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 06:24:40PM +0200, Lee Garrett wrote: > On 21.09.23 18:08, Richard W.M. Jones wrote: > >On Thu, Sep 21, 2023 at 04:50:26PM +0200, Lee Garrett wrote: > >>After testing it again today, the guest agent is still not > >>installed, however this time the C:\Program > >>Files\Guestf

Re: [Libguestfs] Fwd: virt-v2v creating image that does not install guest agent on first boot

2023-09-21 Thread Lee Garrett
On 21.09.23 19:43, Richard W.M. Jones wrote: On Thu, Sep 21, 2023 at 06:24:40PM +0200, Lee Garrett wrote: On 21.09.23 18:08, Richard W.M. Jones wrote: On Thu, Sep 21, 2023 at 04:50:26PM +0200, Lee Garrett wrote: After testing it again today, the guest agent is still not installed, however this

[Libguestfs] [libnbd PATCH v2 6/6] info: Tolerate missing size

2023-09-21 Thread Eric Blake
As previous patches showed, the NBD spec does not yet forbid a server sending us a size that does not fit in int64_t. We should gracefully handle this during nbdinfo, rather than giving up early. With the same one-line hack to qemu to set the most significant bit of the export size, output change

[Libguestfs] [libnbd PATCH v2 4/6] block_status: Fix assertion with large server size

2023-09-21 Thread Eric Blake
As mentioned in the previous commit ("api: Sanitize sizes larger than INT64_MAX"), the NBD spec does not (yet) prohibit a server from advertising a size larger than INT64_MAX. While we can't report such size to the user, v1.16 was at least internally consistent with the server's size everywhere el

[Libguestfs] [libnbd PATCH v2 2/6] fuzzing: Disable client-side strictness checks

2023-09-21 Thread Eric Blake
When fuzzing, it is more desirable to always provoke the server into sending a response, rather than sometimes accidentally skipping a wire call because a client-side strictness test failed. [Our fuzzer could probably be made even more powerful by changing the fuzzer input file to be a series of r

[Libguestfs] [libnbd PATCH v2 1/6] states: Tweak comment in OPT_GO state handler

2023-09-21 Thread Eric Blake
While auditing code, I stumbled across a confusing comment which references a state name that does not exist. In addition to improving the comment, I added an assertion, since there is action at a distance (prepare_for_reply_payload is in states-newstyle.c) for ignoring the oversized payload. Sig

[Libguestfs] [libnbd PATCH v2 5/6] block_status: Fix assertion on bad 64-bit block status reply

2023-09-21 Thread Eric Blake
If a server replies to a block status command with an invalid count in NBD_REPLY_TYPE_BLOCK_STATUS_EXT, we correctly detect the server's error, but fail to mark that we've consumed enough data off the wire to resync back to the server's next reply. Rich's fuzzing run initially found this, but I wa

[Libguestfs] [libnbd PATCH v2 0/6] Fix fuzzer fallout

2023-09-21 Thread Eric Blake
Cat's out of the bag: Rich's fuzzer run found not one, but two independent assertion failures that a malicious server could trigger in my recent 64-bit extension code additions. What's more, in the process of fixing them, we've discovered another long-standing issue where nbd_get_size() returns co

[Libguestfs] [libnbd PATCH v2 3/6] api: Sanitize sizes larger than INT64_MAX

2023-09-21 Thread Eric Blake
Our stable API has always claimed that nbd_get_size() reports a non-negative value on success, and -1 on failure. While we know of no existing production server (such as nbdkit, qemu-nbd, nbd-server) that would advertise a size larger than off_t, the NBD spec has not yet committed to enforcing a h

Re: [Libguestfs] [libnbd PATCH v2 3/6] api: Sanitize sizes larger than INT64_MAX

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 03:58:02PM -0500, Eric Blake wrote: > Our stable API has always claimed that nbd_get_size() reports a > non-negative value on success, and -1 on failure. While we know of no > existing production server (such as nbdkit, qemu-nbd, nbd-server) that > would advertise a size la

Re: [Libguestfs] [libnbd PATCH v2 2/6] fuzzing: Disable client-side strictness checks

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 03:58:01PM -0500, Eric Blake wrote: > When fuzzing, it is more desirable to always provoke the server into > sending a response, rather than sometimes accidentally skipping a wire > call because a client-side strictness test failed. > > [Our fuzzer could probably be made ev

Re: [Libguestfs] [libnbd PATCH v2 5/6] block_status: Fix assertion on bad 64-bit block status reply

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 03:58:04PM -0500, Eric Blake wrote: > If a server replies to a block status command with an invalid count in > NBD_REPLY_TYPE_BLOCK_STATUS_EXT, we correctly detect the server's > error, but fail to mark that we've consumed enough data off the wire > to resync back to the ser

Re: [Libguestfs] [libnbd PATCH v2 4/6] block_status: Fix assertion with large server size

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 03:58:03PM -0500, Eric Blake wrote: > As mentioned in the previous commit ("api: Sanitize sizes larger than > INT64_MAX"), the NBD spec does not (yet) prohibit a server from > advertising a size larger than INT64_MAX. While we can't report such > size to the user, v1.16 was

Re: [Libguestfs] [libnbd PATCH v2 6/6] info: Tolerate missing size

2023-09-21 Thread Richard W.M. Jones
On Thu, Sep 21, 2023 at 03:58:05PM -0500, Eric Blake wrote: > As previous patches showed, the NBD spec does not yet forbid a server > sending us a size that does not fit in int64_t. We should gracefully > handle this during nbdinfo, rather than giving up early. > > With the same one-line hack to