]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Fully resolve paths with virFileComparePaths
authorJames Le Cuirot <jlecuirot@microsoft.com>
Thu, 24 Jul 2025 13:49:37 +0000 (14:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 29 Jul 2025 08:40:44 +0000 (10:40 +0200)
The description says it "resolve all symlinks", but it was only
resolving the last component.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virfile.c

index 3b7a795d459addfe2401f833ff0f409d3013f8bd..a5c9fbe0d92408996f23413327a9dbd323a97474 100644 (file)
@@ -4108,11 +4108,11 @@ virFileComparePaths(const char *p1, const char *p2)
      * 'sysfs', since they're no real paths so fallback to plain string
      * comparison.
      */
-    ignore_value(virFileResolveLink(p1, &res1));
+    ignore_value(virFileResolveAllLinks(p1, &res1));
     if (!res1)
         res1 = g_strdup(p1);
 
-    ignore_value(virFileResolveLink(p2, &res2));
+    ignore_value(virFileResolveAllLinks(p2, &res2));
     if (!res2)
         res2 = g_strdup(p2);