]> xenbits.xensource.com Git - libvirt.git/commit
qemu_shim: URI escape root directory
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Feb 2021 16:27:26 +0000 (17:27 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Feb 2021 16:59:42 +0000 (17:59 +0100)
commit859f7e2072b4109a05e7c491edf2b1c0066c3b23
tree8facbdace8c161da390594e865cf813782536760
parentf28a652a32e0764e1ab528a004c33a49937a0c45
qemu_shim: URI escape root directory

The root directory can be provided by user (or a temporary one is
generated) and is always formatted into connection URI for both
secret driver and QEMU driver, like this:

  qemu:///embed?root=$root

But if it so happens that there is an URI unfriendly character in
root directory or path to it (say a space) then invalid URI is
formatted which results in unexpected results. We can trust
g_dir_make_tmp() to generate valid URI but we can't trust user.
Escape user provided root directory. Always.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1920400
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_shim.c