mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Block all use of libvirt.so in setuid programs
Avoid people introducing security flaws in their apps by forbidding the use of libvirt.so in setuid programs, with a check in virInitialize. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
9b0af09240
commit
9cd6a57db6
@ -409,6 +409,14 @@ virGlobalInit(void)
|
||||
virErrorInitialize() < 0)
|
||||
goto error;
|
||||
|
||||
#ifndef IN_VIRT_LOGIN_SHELL
|
||||
if (virIsSUID()) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("libvirt.so is not safe to use from setuid programs"));
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_GNUTLS_GCRYPT
|
||||
/*
|
||||
* This sequence of API calls it copied exactly from
|
||||
|
Loading…
Reference in New Issue
Block a user