mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
rpc: Don't check the output of virGetUserConfigDirectory()
virGetUserConfigDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2db0583c73
commit
964482aec2
@ -455,11 +455,9 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host,
|
|||||||
knownhosts = g_strdup(knownHostsPath);
|
knownhosts = g_strdup(knownHostsPath);
|
||||||
} else {
|
} else {
|
||||||
confdir = virGetUserConfigDirectory();
|
confdir = virGetUserConfigDirectory();
|
||||||
if (confdir) {
|
virBufferAsprintf(&buf, "%s/known_hosts", confdir);
|
||||||
virBufferAsprintf(&buf, "%s/known_hosts", confdir);
|
if (!(knownhosts = virBufferContentAndReset(&buf)))
|
||||||
if (!(knownhosts = virBufferContentAndReset(&buf)))
|
goto no_memory;
|
||||||
goto no_memory;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (privkeyPath) {
|
if (privkeyPath) {
|
||||||
@ -556,8 +554,7 @@ virNetClientPtr virNetClientNewLibssh(const char *host,
|
|||||||
knownhosts = g_strdup(knownHostsPath);
|
knownhosts = g_strdup(knownHostsPath);
|
||||||
} else {
|
} else {
|
||||||
confdir = virGetUserConfigDirectory();
|
confdir = virGetUserConfigDirectory();
|
||||||
if (confdir)
|
knownhosts = g_strdup_printf("%s/known_hosts", confdir);
|
||||||
knownhosts = g_strdup_printf("%s/known_hosts", confdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (privkeyPath) {
|
if (privkeyPath) {
|
||||||
|
Loading…
Reference in New Issue
Block a user