mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +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>
(cherry picked from commit 9cd6a57db6
)
This commit is contained in:
parent
903db21081
commit
643f5fcf3a
@ -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