From nobody Fri Jan 9 08:49:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1766070115; cv=none; d=zohomail.com; s=zohoarc; b=JwRLm8GEthhV5P7rPmvCnAJDZGyVj0nxYh4CyLfq7FPYPSZ6lmeKf6xRd/85MhgV0ScNs9d9YJ8BLFfDU+LzM2a+8aYCHQBNsjlBDs4D/o1/YQYsHwvH2XF6KOPbSqKO8x3FTeK+jfYAJ3cmP5RlJ3yvLmyn7oKL1HV4GSBoUtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766070115; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=+7Xx8GWicI2nS5XEx5Fze3AJfr73kqMlnGyyDcjUBkc=; b=dMG4B/cFNIrWryrgGTa4ayaJ7t8M0a9P9ekVseXLEHaNwSIonU/fX+qgzMHd2+5awwvYaCGSL0iKJ0yCVeuAYGe5aLVeWuQEWMIumM08+EWL6sLtgZcXovPCdeX+RlRaVR5OuPSYEMMbtE9oSGXtpl78O68m03Q5L2I386WlUNE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1766070115571796.3677149226725; Thu, 18 Dec 2025 07:01:55 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 09F3D4185D; Thu, 18 Dec 2025 10:01:38 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 138564193F; Thu, 18 Dec 2025 10:00:40 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id BB9EC41847; Thu, 18 Dec 2025 09:53:39 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 3A8AC41843 for ; Thu, 18 Dec 2025 09:53:38 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-625-56ooCHigO92exWEfpYfttQ-1; Thu, 18 Dec 2025 09:53:36 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E1421800642 for ; Thu, 18 Dec 2025 14:53:36 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6BA5619560B4 for ; Thu, 18 Dec 2025 14:53:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766069617; h=from:from: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; bh=+7Xx8GWicI2nS5XEx5Fze3AJfr73kqMlnGyyDcjUBkc=; b=IdJOws1y4I4xgqRz0VTyhuaMEVQ/5AhyqV5CV0HDy0hUZLmzn4ny6Tdj0KwUUFWHGKyO+g 4MIhBof/ji0HyAgrb1ghxZ8f94QDt6G0t1GHq/tmuDSmWXz6XdjZOFaHzi0+s4KpfhxxyK XobEbc2BJgALtrDShYbWerXHxYgCLRA= X-MC-Unique: 56ooCHigO92exWEfpYfttQ-1 X-Mimecast-MFC-AGG-ID: 56ooCHigO92exWEfpYfttQ_1766069616 To: devel@lists.libvirt.org Subject: [PATCH v2 2/2] qemu_dbus: Escape path to dbus-daemon socket if needed Date: Thu, 18 Dec 2025 15:53:30 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: u00FfZ3aQs_IPDxjpfMWpizljYNdeDNWNmw8s0cRyf4_1766069616 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DWQACEU6X4VU3PG3RK3FSACBNKMJM7RM X-Message-ID-Hash: DWQACEU6X4VU3PG3RK3FSACBNKMJM7RM X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1766070118500158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Inside of qemuDBusWriteConfig() the config file for dbus-daemon is written. In it is path to the socket where the daemon should listen to. But the path is derived from guest name and as such may contain characters that DBus requires escaped (e.g. a space). Use virStringEscapeDBus() to escape the path before writing it into the config file. Closes: https://gitlab.com/libvirt/libvirt/-/issues/834 Signed-off-by: Michal Privoznik --- src/qemu/qemu_dbus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_dbus.c index 625884ad46..777facbcf4 100644 --- a/src/qemu/qemu_dbus.c +++ b/src/qemu/qemu_dbus.c @@ -25,6 +25,7 @@ #include "virtime.h" #include "virpidfile.h" #include "virutil.h" +#include "virstring.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 @@ -119,6 +120,7 @@ static int qemuDBusWriteConfig(const char *filename, const char *path, bool privilege= d) { g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *escapedPath =3D virStringEscapeDBus(path); g_autofree char *config =3D NULL; =20 virBufferAddLit(&buf, "org.libvirt.qemu\n"); - virBufferAsprintf(&buf, "unix:path=3D%s\n", path); + virBufferAsprintf(&buf, "unix:path=3D%s\n", escapedPa= th); virBufferAddLit(&buf, "EXTERNAL\n"); =20 virBufferAddLit(&buf, "\n"); --=20 2.51.2