]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: protect path_has_protocol from filenames with colons
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 May 2012 14:51:48 +0000 (16:51 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 10 May 2012 08:32:12 +0000 (10:32 +0200)
commit947995c09ebd35a752837a5573985ba5a9942ec1
tree9365a0a9f92be7685f09d2325ef70192dcd74545
parentf53f4da9c68941fe70a3ca9e3fc792c8acf69c0c
block: protect path_has_protocol from filenames with colons

path_has_protocol will erroneously return "true" if the colon is part
of a filename.  These names are common with stable device names produced
by udev.  We cannot fully protect against this in case the filename
does not have a path component (e.g. if the current directory is
/dev/disk/by-path), but in the common case there will be a slash before
and path_has_protocol can easily detect that and return false.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c