From nobody Thu May 15 00:07:59 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 151862043406722.34170163479166; Wed, 14 Feb 2018 07:00:34 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 69BF2A328D; Wed, 14 Feb 2018 15:00:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 168FE67656; Wed, 14 Feb 2018 15:00:32 +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 C84A04A476; Wed, 14 Feb 2018 15:00:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1EEw97U017125 for ; Wed, 14 Feb 2018 09:58:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 91950B3016; Wed, 14 Feb 2018 14:58:09 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DA25B3015; Wed, 14 Feb 2018 14:58:08 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 14 Feb 2018 15:57:25 +0100 Message-Id: <2798d6f8e7160bc14fe7419c9426429f02e170f5.1518618392.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/3] util: storage: Remove detected authentication data for backing chains 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 14 Feb 2018 15:00:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We can't really detect all the authentication data in a sane manner for disk backing chains. Since the old RBD parser parses it in some cases as the argv->XML convertor requires it, we can't just drop it. Instead clear any detected authentication data in the code paths related to disk backing chain lookup and fix the tests to cope with the change. https://bugzilla.redhat.com/show_bug.cgi?id=3D1544659 Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 8 ++++++++ tests/virstoragetest.c | 15 +++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 7f878039ba..440d2b3040 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -3399,6 +3399,14 @@ virStorageSourceNewFromBackingAbsolute(const char *p= ath) goto error; virStorageSourceNetworkAssignDefaultPorts(ret); + + /* Some of the legacy parsers parse authentication data since they= are + * also used in other places. For backing store detection the + * authentication data would be invalid anyways, so we clear it */ + if (ret->auth) { + virStorageAuthDefFree(ret->auth); + ret->auth =3D NULL; + } } return ret; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 6eed7134ed..a39c00bab5 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -308,8 +308,7 @@ static const char testStorageChainFormat[] =3D "type:%d\n" "format:%d\n" "protocol:%s\n" - "hostname:%s\n" - "secret:%s\n"; + "hostname:%s\n"; static int testStorageChain(const void *args) @@ -374,8 +373,7 @@ testStorageChain(const void *args) data->files[i]->type, data->files[i]->format, virStorageNetProtocolTypeToString(data->files[i]->= protocol), - NULLSTR(data->files[i]->hostname), - NULLSTR(data->files[i]->secret)) < 0 || + NULLSTR(data->files[i]->hostname)) < 0 || virAsprintf(&actual, testStorageChainFormat, i, NULLSTR(elt->path), @@ -386,8 +384,7 @@ testStorageChain(const void *args) elt->type, elt->format, virStorageNetProtocolTypeToString(elt->protocol), - NULLSTR(elt->nhosts ? elt->hosts[0].name : NULL), - NULLSTR(elt->auth ? elt->auth->username : NULL)) <= 0) { + NULLSTR(elt->nhosts ? elt->hosts[0].name : NULL)) = < 0) { VIR_FREE(expect); VIR_FREE(actual); goto cleanup; @@ -1361,9 +1358,6 @@ mymain(void) TEST_BACKING_PARSE("rbd:testshare:id=3Dasdf:mon_host=3Dexample.com", "\n" " \n" - " \n" - " \n" - " \n" "\n"); TEST_BACKING_PARSE("nbd:example.org:6000:exportname=3Dblah", "\n" @@ -1529,9 +1523,6 @@ mymain(void) "}", "\n" " \n" - " \n" - " \n" - " \n" "\n"); TEST_BACKING_PARSE("json:{\"file\":{\"driver\":\"rbd\"," "\"image\":\"test\"," --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list