From nobody Tue May 13 18:57:17 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534266508668150.99947082846222; Tue, 14 Aug 2018 10:08:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 67E9E356CB; Tue, 14 Aug 2018 17:08:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FCFC10694FB; Tue, 14 Aug 2018 17:08:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C10D118037ED; Tue, 14 Aug 2018 17:08:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7EH816n003321 for ; Tue, 14 Aug 2018 13:08:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id B92B517C00; Tue, 14 Aug 2018 17:08:01 +0000 (UTC) Received: from unknown4CEB42C824F4.redhat.com (ovpn-116-168.phx2.redhat.com [10.3.116.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 772A95D9C5 for ; Tue, 14 Aug 2018 17:08:01 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 14 Aug 2018 13:07:53 -0400 Message-Id: <20180814170756.19205-9-jferlan@redhat.com> In-Reply-To: <20180814170756.19205-1-jferlan@redhat.com> References: <20180814170756.19205-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/11] phyp: Don't overwrite virAuthGet{Username|Password} errors X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 Aug 2018 17:08:27 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 --- src/phyp/phyp_driver.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 5b17508dae..28a1fa3c26 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -957,13 +957,9 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr a= uth, if (VIR_STRDUP(username, conn->uri->user) < 0) goto err; } else { - username =3D virAuthGetUsername(conn, auth, "ssh", NULL, conn->uri= ->server); - - if (username =3D=3D NULL) { - virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("Username request failed")); + if (!(username =3D virAuthGetUsername(conn, auth, "ssh", NULL, + conn->uri->server))) goto err; - } } =20 memset(&hints, 0, sizeof(hints)); @@ -1034,13 +1030,9 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr= auth, || rc =3D=3D LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED || rc =3D=3D LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) { =20 - password =3D virAuthGetPassword(conn, auth, "ssh", username, conn-= >uri->server); - - if (password =3D=3D NULL) { - virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("Password request failed")); + if (!(password =3D virAuthGetPassword(conn, auth, "ssh", username, + conn->uri->server))) goto disconnect; - } =20 while ((rc =3D libssh2_userauth_password(session, username, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list