mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
phyp: Don't overwrite virAuthGet{Username|Password} errors
Now that the virAuthGet*Path API's generate all the error messages we can remove them from the callers. This means that we will no longer overwrite the error from the API. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
This commit is contained in:
parent
56a06e5089
commit
62b04f698c
@ -957,13 +957,9 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
||||
if (VIR_STRDUP(username, conn->uri->user) < 0)
|
||||
goto err;
|
||||
} else {
|
||||
username = virAuthGetUsername(conn, auth, "ssh", NULL, conn->uri->server);
|
||||
|
||||
if (username == NULL) {
|
||||
virReportError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
_("Username request failed"));
|
||||
if (!(username = virAuthGetUsername(conn, auth, "ssh", NULL,
|
||||
conn->uri->server)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
@ -1034,13 +1030,9 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
||||
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
|
||||
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) {
|
||||
|
||||
password = virAuthGetPassword(conn, auth, "ssh", username, conn->uri->server);
|
||||
|
||||
if (password == NULL) {
|
||||
virReportError(VIR_ERR_AUTH_FAILED, "%s",
|
||||
_("Password request failed"));
|
||||
if (!(password = virAuthGetPassword(conn, auth, "ssh", username,
|
||||
conn->uri->server)))
|
||||
goto disconnect;
|
||||
}
|
||||
|
||||
while ((rc =
|
||||
libssh2_userauth_password(session, username,
|
||||
|
Loading…
Reference in New Issue
Block a user