From nobody Tue Sep 9 02:51:55 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=1748519645; cv=none; d=zohomail.com; s=zohoarc; b=C0rimtZ6bCIt8FHOU82no7D06nXbFpEUt/uq4dei590kxQEMDQeLoi3rGlqTWw0m7+gAGWEP+L5xfFuTeqextSxntTN/XT7+xU7gThUxkuG4tNCgjjnWaFlUVjq6qIjOreyuCAQNsbPhoGyZTecvMzpg5VCtsZocRCMeaJ/afho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748519645; 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=AhJLVExzyPG4EcWMJcmsC2es/8dGIMYZRas8RpSBf2A=; b=BjCk2+nhlaSNIg0YipOGdF4BCb7ijL6/LMLOz2zSJuEd4SvwbWX392Tq39KmF1uU7/fjI24nBhvbpJ51uAH/x3nAGmVulNS1OZuGRWsoPv4Larq9NIIBqMVCVB6p9b6KfhXBxJp6rgWCsWrc5FfWJo0UplXNoMZptdlTDD9+q58= 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 1748519645531888.1927774953461; Thu, 29 May 2025 04:54:05 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 880C2154E; Thu, 29 May 2025 07:54:04 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 28B9E17F4; Thu, 29 May 2025 07:53:31 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A0C1913F5; Thu, 29 May 2025 07:53:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 298CF1367 for ; Thu, 29 May 2025 07:53:26 -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-361--B02mZonPiK0d2gr6JfZcQ-1; Thu, 29 May 2025 07:53:24 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 9DFA9180035F for ; Thu, 29 May 2025 11:53:23 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1EEC219560AF for ; Thu, 29 May 2025 11:53:22 +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=1748519605; 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=IEBGtEp7IW0NS01SezR8PM5nBnLFpHcNUGwmFe+tiuw=; b=cxz3FwfTTsANNM3AWGwxK2nf1z0LgUPxl5r/18nQ1vuBZOUWXrvn4cAZK7iU0v1UKa5UEu A2u+0Gy+siFVSQZO9JtWsPHn4uZXHawlH9ky3cqKv+3N6rTVXSvhBbISpCRCSynQgIcFzD FQOt9hCU89Q0JsbSOXljRNftyEnIs5o= X-MC-Unique: -B02mZonPiK0d2gr6JfZcQ-1 X-Mimecast-MFC-AGG-ID: -B02mZonPiK0d2gr6JfZcQ_1748519603 To: devel@lists.libvirt.org Subject: [PATCH 1/3] util: Document limitation of virFileCanonicalizePath Date: Thu, 29 May 2025 13:53:16 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Dk2FxVALqhDUKm30G61lSa6YPcQbIQeQYNb2QrduLTk_1748519603 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DXICGKXYA7PLZNYGVVEWM45KE2NIGD4L X-Message-ID-Hash: DXICGKXYA7PLZNYGVVEWM45KE2NIGD4L X-MailFrom: jdenemar@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: Jiri Denemark via Devel Reply-To: Jiri Denemark X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748519646611116600 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark On most platforms virFileCanonicalizePath is implemented using realpath(), which only works on existing paths. Signed-off-by: Jiri Denemark --- src/util/virfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 7cab3d0cd6..242aa7ff88 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3408,7 +3408,8 @@ virFileSanitizePath(const char *path) /** * virFileCanonicalizePath: * - * Returns the canonical representation of @path. + * Returns the canonical representation of @path. This function is only + * guaranteed to work when @path exists. It may return NULL otherwise. * * The returned string must be freed after use. */ --=20 2.49.0