From nobody Thu May 2 12:10:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586853578; cv=none; d=zohomail.com; s=zohoarc; b=A2AacLtbv0UTLHobKZgXzDTwq78OtE9CfTuvpjY425n+Ro25NqFpGjjTQOkyZrmPEF0RqkeeYm7UlcqZzz0K16kSl2s5vrV+fYnCjUWUHDe6hTBXui4O5fcLB9Pw3n02MDecish/dRO1AWz/W5KCgckotBCVfENQ2L1Xk/w9urQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586853578; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GkqfT7csZVgaYiEAEOor+V45a5qLsTapMAnKaDrIkv0=; b=LG/8CJqc5T8kd9By8WMFTgaFoArgFjFdsf65+QQS47ftT3zAi9y+xkNTZcmEEJqABgK+5Wvy5xWI4bV5cfhLXnc0fwBQhlrsuXBSPz7KEaRsiCwKaO3KVQn+ngjKOSwR3XJPCbYGcWc7QjiA41JSuu5Yg9a72HdrS3/ITOtnoj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1586853578245534.9470446953012; Tue, 14 Apr 2020 01:39:38 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-ApNoGdjKMmyysbMtFNRZ3Q-1; Tue, 14 Apr 2020 04:39:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32CF9801F74; Tue, 14 Apr 2020 08:39:29 +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 DECA3116D84; Tue, 14 Apr 2020 08:39:28 +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 5EA5318089C8; Tue, 14 Apr 2020 08:39:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03E8csQP015192 for ; Tue, 14 Apr 2020 04:38:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id C84E710016DA; Tue, 14 Apr 2020 08:38:54 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33E0E10027A9 for ; Tue, 14 Apr 2020 08:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586853576; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GkqfT7csZVgaYiEAEOor+V45a5qLsTapMAnKaDrIkv0=; b=BZ9c9IZmHUyV4W/PdWIN1y5hGRohTlR2btYaULWhmOE+eGhNuAUILqRn+q2rwCk6OlsjlP +rCoejCq2bw57mxg3D69qTqbNc6CqijFc1vPGUSI+gyCSBZVrcRw+PBlKfYd9Zb+kVU6Ja UTxAMSAJeQO7vth2fKkqUaV3BTDBjNQ= X-MC-Unique: ApNoGdjKMmyysbMtFNRZ3Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] virstoragetest: testBackingParse: Use VIR_DOMAIN_DEF_FORMAT_SECURE when formatting xml Date: Tue, 14 Apr 2020 10:38:47 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We want to format even the secure information in tests. Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- tests/virstoragetest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 6e8ebeba13..6d2b21c25f 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -594,6 +594,7 @@ testBackingParse(const void *args) g_autoptr(virStorageSource) src =3D NULL; int rc; int erc =3D data->rv; + unsigned int xmlformatflags =3D VIR_DOMAIN_DEF_FORMAT_SECURE; /* expect failure return code with NULL expected data */ if (!data->expect) @@ -613,7 +614,7 @@ testBackingParse(const void *args) return -1; } - if (virDomainDiskSourceFormat(&buf, src, "source", 0, false, 0, true, = NULL) < 0 || + if (virDomainDiskSourceFormat(&buf, src, "source", 0, false, xmlformat= flags, true, NULL) < 0 || !(xml =3D virBufferContentAndReset(&buf))) { fprintf(stderr, "failed to format disk source xml\n"); return -1; --=20 2.26.0 From nobody Thu May 2 12:10:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586853552; cv=none; d=zohomail.com; s=zohoarc; b=Nbpy8rAdxNM+mJXjW2+rJN995GWIfHD1th8g7vUboU3uIOTylN0bX/lPk3J0w5eDF9JgF+p4ulfBVl1c2YvUNOYBLNQEQgvkiOMqrgaQjkuQpO5CHo8E/nJhf5lkUxDrM5EgZOV143+Poh43IpNJ7fOjZ3cq++quTOyhKU5tFYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586853552; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=evnQb3OrbSNdozT+p6+k7wI2qY2qV7IWRRgEetVim2o=; b=aHot+5OMdtMzOOJDf3QY9JtR3WNVCPr80cbjmPLPDYXDHwbXaijQwtVOXoQoOLtzrtmz+4TBSxqmKdmDLhyp9fxZkpUgFGKD5VvaplC/BO70VA6LGg/5uNrdGmsbhf1MVsc7qI/Wjxnm2OnXa99wehrKfMVPdBFzMx1hpVSXfYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1586853552038757.137351117556; Tue, 14 Apr 2020 01:39:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-p_yNBesCOaOLUZ62LaSH5w-1; Tue, 14 Apr 2020 04:39:08 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7ABFA107ACCC; Tue, 14 Apr 2020 08:39:02 +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 9C27DC0DBA; Tue, 14 Apr 2020 08:39:01 +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 A048C93068; Tue, 14 Apr 2020 08:38:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03E8ctmj015204 for ; Tue, 14 Apr 2020 04:38:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id C241E1001DDE; Tue, 14 Apr 2020 08:38:55 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3452510016DA for ; Tue, 14 Apr 2020 08:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586853550; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=evnQb3OrbSNdozT+p6+k7wI2qY2qV7IWRRgEetVim2o=; b=XQ2GCm25cj05xwVungxyhgglN9pwQC9OAspaA7NbcGMzCV1hC00P3LobLPpdCDKBto40as ZvOUhWJcQU8YEBOb0xjxOo4XL2gSJ/mACHCVUfMzuBnHsfDvCTp4bITJbibGbSMf1X6lKt GSXmFemMuEwrGYczVS9pVkO0RfPr4Rw= X-MC-Unique: p_yNBesCOaOLUZ62LaSH5w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used Date: Tue, 14 Apr 2020 10:38:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Starting from 3b076391befc3fe72deb0c244ac6c2b4c100b410 (v6.1.0-122-g3b076391be) we support http cookies. Since they may contain somewhat sensitive information we should not format into the XML unless VIR_DOMAIN_DEF_FORMAT_SECURE is asserted. Reported-by: Han Han Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- src/conf/domain_conf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8e8146374c..8700d56761 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24636,11 +24636,15 @@ virDomainSourceDefFormatSeclabel(virBufferPtr buf, static void virDomainDiskSourceFormatNetworkCookies(virBufferPtr buf, - virStorageSourcePtr src) + virStorageSourcePtr src, + unsigned int flags) { g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); size_t i; + if (!(flags & VIR_DOMAIN_DEF_FORMAT_SECURE)) + return; + for (i =3D 0; i < src->ncookies; i++) { virBufferEscapeString(&childBuf, "", src->cook= ies[i]->name); virBufferEscapeString(&childBuf, "%s\n", src->cookies[i]-= >value); @@ -24701,7 +24705,7 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrB= uf, virTristateBoolTypeToString(src->sslverify)); } - virDomainDiskSourceFormatNetworkCookies(childBuf, src); + virDomainDiskSourceFormatNetworkCookies(childBuf, src, flags); if (src->readahead) virBufferAsprintf(childBuf, "\n", src->r= eadahead); --=20 2.26.0