From nobody Tue Sep 9 03:40:00 2025 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; 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=1749732614; cv=none; d=zohomail.com; s=zohoarc; b=ZeE0ESToCiJWRM/FgyeUYGL2P4ToUYPDk5TLP4rNhVti/xFRKC4Kl4hMUyzx29u4eTJ5dKYIQ+NOP3s0kR4YTi5A+qDUA+GpOHDmhYnbUi/aXlbM1Bks+zKOkUNNLRB/x7PPl3mByvOXvKwKAeXk3wjMt3jVlsYb+aYZ7W6mmAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749732614; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post: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=hlbQ7+e3v/T7eAWWGih2grt1ms/CJWUCdxGH7YGseY0=; b=gzUSIOW1k2Mv91vJo/4V7al9GZroxgoL0GN0LJj2QUhEkqFhd3lPTPgPfS0An9/j3i7LOZuS56O8R1O3Gvm/wq8AWos5fS1D9zHLE0fL66HmVtE7j5ltqBhX1gFOpcHN0YqCNQiD+VVauYvF5p0a5tOtzntH0uqpdMW72f9KVNM= 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 1749732614640941.2922209705371; Thu, 12 Jun 2025 05:50:14 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9DC68E6B; Thu, 12 Jun 2025 08:50:13 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 9EEB112C1; Thu, 12 Jun 2025 08:49:02 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D952AD44; Thu, 12 Jun 2025 08:48:56 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5EF51D46 for ; Thu, 12 Jun 2025 08:48:56 -0400 (EDT) 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-596-4qJ53-RhPAqZ110WXOEBYg-1; Thu, 12 Jun 2025 08:48:53 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 5AE8E1800294 for ; Thu, 12 Jun 2025 12:48:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 98F7E195609D for ; Thu, 12 Jun 2025 12:48:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749732536; 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=kCIz3fepH+iX7GMwBoJhf0uM08dMS27cU6SjRsc4hiA=; b=SXI8pIdCa6ypRlmNKUU5GCTFxLJWAvW9lu3co1/eVsX1crN6Lmy+/GSgbMAP7/dIS4lDDn ppjMVHP5munXZ9VUbtA9UmHbQJ6LXgJDLSz0srg0RegQgyzH1x99e4MyfRPURF8UqJcgs9 CFZpHkMqdgvlmEw6dfsj5ddp80DUf6k= X-MC-Unique: 4qJ53-RhPAqZ110WXOEBYg-1 X-Mimecast-MFC-AGG-ID: 4qJ53-RhPAqZ110WXOEBYg_1749732532 To: devel@lists.libvirt.org Subject: [PATCH 01/15] log_cleaner: Use virFileCanonicalizePath() Date: Thu, 12 Jun 2025 14:48:33 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: E_ePAMqV0yySEIpTVhHQ3t2COrGDRnSUjPsiEhespMk_1749732532 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: J6T7VAS6QLSZHEIODAJKRP5QFQNCVT7O X-Message-ID-Hash: J6T7VAS6QLSZHEIODAJKRP5QFQNCVT7O X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: 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: 1749732614970116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik While use of realpath() is not forbidden, our some of our mocks already have a test friendly reimplementation of virFileCanonicalizePath(). Use the latter. Signed-off-by: Michal Privoznik --- src/logging/log_cleaner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging/log_cleaner.c b/src/logging/log_cleaner.c index 4efcbc18e4..d247fdf829 100644 --- a/src/logging/log_cleaner.c +++ b/src/logging/log_cleaner.c @@ -66,7 +66,7 @@ virLogCleanerParseFilename(const char *path, g_autofree char *clear_path =3D NULL; char *chain_prefix =3D NULL; =20 - clear_path =3D realpath(path, NULL); + clear_path =3D virFileCanonicalizePath(path); if (!clear_path) { VIR_WARN("Failed to resolve path %s: %s", path, g_strerror(errno)); return NULL; --=20 2.49.0