[libvirt] [libvirt[]PATCH v2] Fix URI alias prefix matching
Philipp Hahn
hahn at univention.de
Tue Nov 1 07:12:53 UTC 2011
Hello Wen,
On Tuesday 01 November 2011 04:08:24 Wen Ruo Lv wrote:
> With /etc/libvirt/libvirt.conf below:
> uri_aliases = [
> "hail=qemu:///system",
> "sleet=qemu+ssh://root 9 115 122 57/system",
> "sam=qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock",
> ]
> Issue "virsh -c hailly" results in matching "hail=qemu:///system"
...
> - if (STREQLEN(entry->str, alias, offset-entry->str)) {
> + if (STREQLEN(entry->str, alias, strlen(alias))) {
Now you have it the other way around, that any prefix matches:
"virsh -c hai" will match "hail".
Why not simply use STREQ instead of STREQLEN?
Sincerely
Philipp
--
Philipp Hahn Open Source Software Engineer hahn at univention.de
Univention GmbH Linux for Your Business fon: +49 421 22 232- 0
Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99
http://www.univention.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111101/6346be46/attachment-0001.sig>
More information about the libvir-list
mailing list