mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
phyp: Drop check for auth and auth->cb
Since they are done inside virAuthGetPassword and virAuthGetUsername when needed. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
This commit is contained in:
parent
dd2a6cc80b
commit
93db97ee40
@ -957,12 +957,6 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
|||||||
if (VIR_STRDUP(username, conn->uri->user) < 0)
|
if (VIR_STRDUP(username, conn->uri->user) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
} else {
|
} else {
|
||||||
if (auth == NULL || auth->cb == NULL) {
|
|
||||||
virReportError(VIR_ERR_AUTH_FAILED,
|
|
||||||
"%s", _("No authentication callback provided."));
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
username = virAuthGetUsername(conn, auth, "ssh", NULL, conn->uri->server);
|
username = virAuthGetUsername(conn, auth, "ssh", NULL, conn->uri->server);
|
||||||
|
|
||||||
if (username == NULL) {
|
if (username == NULL) {
|
||||||
@ -1039,11 +1033,6 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
|||||||
if (rc == LIBSSH2_ERROR_SOCKET_NONE
|
if (rc == LIBSSH2_ERROR_SOCKET_NONE
|
||||||
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
|
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
|
||||||
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) {
|
|| rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) {
|
||||||
if (auth == NULL || auth->cb == NULL) {
|
|
||||||
virReportError(VIR_ERR_AUTH_FAILED,
|
|
||||||
"%s", _("No authentication callback provided."));
|
|
||||||
goto disconnect;
|
|
||||||
}
|
|
||||||
|
|
||||||
password = virAuthGetPassword(conn, auth, "ssh", username, conn->uri->server);
|
password = virAuthGetPassword(conn, auth, "ssh", username, conn->uri->server);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user