Re: [Libguestfs] [PATCH virt-v2v] -it ssh: Double quote ssh command which tests remote file exists

2023-10-02 Thread Richard W.M. Jones
On Mon, Oct 02, 2023 at 04:09:50PM +0200, Laszlo Ersek wrote:
> On 10/2/23 11:03, Richard W.M. Jones wrote:
> > Double quoting was removed in
> > commit e2af12ba69c4463bb73d30db63290a887cdd41eb ("input: -i vmx:
> > Remove support for openssh scp < 8.8", Nov 2021).  However it should
> > only have been removed from scp commands, not for this ssh command
> > where it is still required.
> > 
> > See: https://github.com/libguestfs/virt-v2v/issues/35
> > Thanks: Laszlo Ersek for diagnosis and suggesting the fix
> > Reported-by: Bill Sanders
> > ---
> >  input/parse_domain_from_vmx.ml | 6 +-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/input/parse_domain_from_vmx.ml b/input/parse_domain_from_vmx.ml
> > index 15ee093f59..2e75e78506 100644
> > --- a/input/parse_domain_from_vmx.ml
> > +++ b/input/parse_domain_from_vmx.ml
> > @@ -97,7 +97,11 @@ let remote_file_exists uri path =
> >   | None -> ""
> >   | Some user -> quote user ^ "@")
> >  (quote (server_of_uri uri))
> > -(quote path) in
> > +(* Double quoting is necessary for 'ssh', first to protect
> > + * from the local shell, second to protect from the remote
> > + * shell.  
> > https://github.com/libguestfs/virt-v2v/issues/35#issuecomment-1741730963
> > + *)
> > +(quote (quote path)) in
> >if verbose () then
> >  eprintf "%s\n%!" cmd;
> >Sys.command cmd = 0
> 
> Reviewed-by: Laszlo Ersek 

I pushed this patch, and the timezone patches (previously reviewed) as
c5c9aa2f77..22c5b98ab7

Even though the timezone patches didn't apparently fix the other bug,
they didn't make it worse and they do seem to be worthwhile changes.

Thanks,

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [PATCH virt-v2v] -it ssh: Double quote ssh command which tests remote file exists

2023-10-02 Thread Laszlo Ersek
On 10/2/23 11:03, Richard W.M. Jones wrote:
> Double quoting was removed in
> commit e2af12ba69c4463bb73d30db63290a887cdd41eb ("input: -i vmx:
> Remove support for openssh scp < 8.8", Nov 2021).  However it should
> only have been removed from scp commands, not for this ssh command
> where it is still required.
> 
> See: https://github.com/libguestfs/virt-v2v/issues/35
> Thanks: Laszlo Ersek for diagnosis and suggesting the fix
> Reported-by: Bill Sanders
> ---
>  input/parse_domain_from_vmx.ml | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/input/parse_domain_from_vmx.ml b/input/parse_domain_from_vmx.ml
> index 15ee093f59..2e75e78506 100644
> --- a/input/parse_domain_from_vmx.ml
> +++ b/input/parse_domain_from_vmx.ml
> @@ -97,7 +97,11 @@ let remote_file_exists uri path =
>   | None -> ""
>   | Some user -> quote user ^ "@")
>  (quote (server_of_uri uri))
> -(quote path) in
> +(* Double quoting is necessary for 'ssh', first to protect
> + * from the local shell, second to protect from the remote
> + * shell.  
> https://github.com/libguestfs/virt-v2v/issues/35#issuecomment-1741730963
> + *)
> +(quote (quote path)) in
>if verbose () then
>  eprintf "%s\n%!" cmd;
>Sys.command cmd = 0

Reviewed-by: Laszlo Ersek 

Thanks!
Laszlo
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



[Libguestfs] [PATCH virt-v2v] -it ssh: Double quote ssh command which tests remote file exists

2023-10-02 Thread Richard W.M. Jones
Double quoting was removed in
commit e2af12ba69c4463bb73d30db63290a887cdd41eb ("input: -i vmx:
Remove support for openssh scp < 8.8", Nov 2021).  However it should
only have been removed from scp commands, not for this ssh command
where it is still required.

See: https://github.com/libguestfs/virt-v2v/issues/35
Thanks: Laszlo Ersek for diagnosis and suggesting the fix
Reported-by: Bill Sanders
---
 input/parse_domain_from_vmx.ml | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/input/parse_domain_from_vmx.ml b/input/parse_domain_from_vmx.ml
index 15ee093f59..2e75e78506 100644
--- a/input/parse_domain_from_vmx.ml
+++ b/input/parse_domain_from_vmx.ml
@@ -97,7 +97,11 @@ let remote_file_exists uri path =
  | None -> ""
  | Some user -> quote user ^ "@")
 (quote (server_of_uri uri))
-(quote path) in
+(* Double quoting is necessary for 'ssh', first to protect
+ * from the local shell, second to protect from the remote
+ * shell.  
https://github.com/libguestfs/virt-v2v/issues/35#issuecomment-1741730963
+ *)
+(quote (quote path)) in
   if verbose () then
 eprintf "%s\n%!" cmd;
   Sys.command cmd = 0
-- 
2.41.0

___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



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

2023-10-02 Thread Richard W.M. Jones
On Mon, Oct 02, 2023 at 01:00:00PM +0800, Ming Xie wrote:
> Hi Richard,
> 
> On Fri, Sep 29, 2023 at 5:45 AM Richard W.M. Jones  wrote:
> 
> On Thu, Sep 28, 2023 at 07:41:55PM +0800, Ming Xie wrote:
> > Hi Richard,
> >
> > On Thu, Sep 28, 2023 at 6:14 PM Richard W.M. Jones 
> wrote:
> >
> >     Ming,
> >
> >     For some reason the build seems "stuck" at the moment, but
> >     if it finishes could you see if this fixes the RHEL 9 case?
> >
> >     https://kojihub.stream.centos.org/koji/taskinfo?taskID=2879547
> 
> It finished building now.
> 
> 
> Use virt-v2v-2.3.4-6.qemugatzbug1.el9.x86_64 to test and get the following
> results, the problem has not been fixed yet.
> 
>        qemu-ga
>   win10-non-UTC-8 PASS
>   Win10-efi-UTC-8  FAIL
>   Win11-non-efi UTC-8   PASS
>   Win11-efi-UTC-8  FAIL(can't find qemu-ga log in c:\)
>   Win11-efi-UTC+8 FAIL(can't find qemu-ga log in c:\)
>   Win2019-efi-UTC-8  PASS
>   Win2022-efi-UTC-8  PASS

OK thanks for testing it.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs