]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
log_cleaner: Use virFileCanonicalizePath()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 11 Jun 2025 11:18:55 +0000 (13:18 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Jul 2025 11:53:49 +0000 (13:53 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/logging/log_cleaner.c

index 4efcbc18e4729fa2f745e31aead022ea11735729..d247fdf82971062609d409290df2ccc83e09ea78 100644 (file)
@@ -66,7 +66,7 @@ virLogCleanerParseFilename(const char *path,
     g_autofree char *clear_path = NULL;
     char *chain_prefix = NULL;
 
-    clear_path = realpath(path, NULL);
+    clear_path = virFileCanonicalizePath(path);
     if (!clear_path) {
         VIR_WARN("Failed to resolve path %s: %s", path, g_strerror(errno));
         return NULL;