]> xenbits.xensource.com Git - libvirt.git/commitdiff
phyp: Drop check for auth and auth->cb
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Fri, 3 Aug 2018 00:27:54 +0000 (21:27 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 14 Aug 2018 14:11:15 +0000 (16:11 +0200)
Since they are done inside virAuthGetPassword and virAuthGetUsername
when needed.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
src/phyp/phyp_driver.c

index d78de832312c4f55c972098828df3302c1188f45..5b17508dae3510c7b043aeb522c1272261562fa4 100644 (file)
@@ -957,12 +957,6 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
         if (VIR_STRDUP(username, conn->uri->user) < 0)
             goto err;
     } 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);
 
         if (username == NULL) {
@@ -1039,11 +1033,6 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
     if (rc == LIBSSH2_ERROR_SOCKET_NONE
         || rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
         || 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);