提交 93db97ee 编写于 作者: M Marcos Paulo de Souza 提交者: Michal Privoznik

phyp: Drop check for auth and auth->cb

Since they are done inside virAuthGetPassword and virAuthGetUsername
when needed.
Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
上级 dd2a6cc8
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册