mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +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)
|
virErrorInitialize() < 0)
|
||||||
goto error;
|
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
|
#ifdef WITH_GNUTLS_GCRYPT
|
||||||
/*
|
/*
|
||||||
* This sequence of API calls it copied exactly from
|
* This sequence of API calls it copied exactly from
|
||||||
|
Loading…
x
Reference in New Issue
Block a user