]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virSecurityManagerMetadataLock: Skip over duplicate paths
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2019 08:59:08 +0000 (10:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2019 13:13:13 +0000 (15:13 +0200)
commitc012e0f7fa80f5efd31f5d89fa7685a713a20d13
tree93e70ebd806d697deaabcc6e44c93239f4beb611
parentee6501ab05175dcb57db3f5899fd1fcfb1957f39
virSecurityManagerMetadataLock: Skip over duplicate paths

If there are two paths on the list that are the same we need to
lock it only once. Because when we try to lock it the second time
then open() fails. And if it didn't, locking it the second time
would fail for sure. After all, it is sufficient to lock all
paths just once satisfy the caller.

Reported-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/security/security_manager.c