Bug 1232477 - guestfs_add_drive_opts incorrectly quotes query parameters
Summary: guestfs_add_drive_opts incorrectly quotes query parameters
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-16 20:31 UTC by Richard W.M. Jones
Modified: 2018-07-18 14:40 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2015-06-16 20:31:57 UTC
Description of problem:

If you use guestfs_add_drive_opts, and the first parameter (the path)
contains a query parameter, it is quoted:

$ guestfish -x -v add "/?foo=bar" protocol:https server:test.example.com readonly:true : run 
...
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -o backing_file=https://test.example.com/%3Ffoo=bar
libguestfs: command: run: \ /tmp/libguestfsXUkwGI/overlay1

Note that the ? is quoted as %3F.

This may or may not be a bug, but it means there is no way to provide
a ?query in a URL when accessing a curl resource.

Version-Release number of selected component (if applicable):

libguestfs-1.29.46-1.fc23.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See above.

Comment 1 Pino Toscano 2015-11-09 17:50:08 UTC
Isn't this somehow duplicated of bug #1092583, whose resolution (passing the query string separately, and reusing it for the protocols using it) would fix this bug as well?

Comment 2 Richard W.M. Jones 2015-11-10 10:52:40 UTC
If you mean we should add an extra parameter to add_drive_opts
to hold the query string, analogous to the secret/password parameter,
then yes I think that may be the right solution.


Note You need to log in before you can comment on or make changes to this bug.