]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuDomainDetachDeviceUnlink: Don't unlink files we haven't created
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 28 Apr 2017 11:17:04 +0000 (13:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 May 2017 15:23:03 +0000 (17:23 +0200)
commit2f0b3b103b329b0b9656ac4fc8b5f94a5c2fa051
treee3d450b452ddbc3e72684ae1d6865f8b0e069408
parentb3418f36be75eb4bdecd6aa37cda7a268519ee46
qemuDomainDetachDeviceUnlink: Don't unlink files we haven't created

Even though there are several checks before calling this function
and for some scenarios we don't call it at all (e.g. on disk hot
unplug), it may be possible to sneak in some weird files (e.g. if
domain would have RNG with /dev/shm/some_file as its backend). No
matter how improbable, we shouldn't unlink it as we would be
unlinking a file from the host which we haven't created in the
first place.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
src/qemu/qemu_domain.c