mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-10-05 07:33:51 +03:00
Remove all direct use of getenv
Unconditional use of getenv is not secure in setuid env. While not all libvirt code runs in a setuid env (since much of it only exists inside libvirtd) this is not always clear to developers. So make all the code paranoid, even if it only ever runs inside libvirtd. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@@ -991,7 +991,7 @@ static int migrateProfile(void)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
config_home = getenv("XDG_CONFIG_HOME");
|
||||
config_home = virGetEnvBlockSUID("XDG_CONFIG_HOME");
|
||||
if (config_home && config_home[0] != '\0') {
|
||||
if (VIR_STRDUP(xdg_dir, config_home) < 0)
|
||||
goto cleanup;
|
||||
|
Reference in New Issue
Block a user