[Libvir] Re: [PATCH] add no_tty flag for ssh

Daniel Veillard veillard at redhat.com
Fri Sep 21 08:39:54 UTC 2007


On Thu, Sep 20, 2007 at 08:06:22PM +0100, Richard W.M. Jones wrote:
> Daniel P. Berrange wrote:
> >On Thu, Sep 20, 2007 at 01:10:28PM +0100, Richard W.M. Jones wrote:
> >>Daniel P. Berrange wrote:
> >>>The use of '-o PasswordAuthentication=no' isn't sufficient because even
> >>>with pulic key / gssapi auth schemes it may prompt for passwords and/or
> >>>passphrases.
> >>>
> >>>I think we need to use  '-T -o BatchMode=yes', and regardless of the
> >>>no_tty flag I think it could be wise to add '-e none'.
> >>Yes, that's right.  Try this patch.
> >
> >There's something not quite right going on. It correctly prevents the
> >prompting of passwords, but the '?' seems to be passed through to the
> >remote end. So the server side tries to open 'qemu:///system?' and
> >fails.
> >
> >Now technically '?' is a valid URI character and so qemu_driver.c should
> >handle it, by parsing the URI properly, rather than STREQ(qemu:///system),
> >but I think the client side should avoid appending the '?' too if there is
> >no parameter to pass across.
> 
> The URI is reconstructed using xmlSaveUri from libxml2, and as far as I 
> can see that always appends a '?' character.

  You must have an empty (and not NULL) query field in the xmlURI,
which is the reason why xmlSaveURI will dump it. It's needed to preserve
empty query strings:

paphio:~/XML -> ./testURI http://foo/?
http://foo/?
paphio:~/XML -> ./testURI http://foo/
http://foo/
paphio:~/XML ->

Solution should be to xmlFree the uri->query if empty, and set the field
to NULL,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list