]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Fix virFileIsSharedFSOverride on nonexistent paths
authorJiri Denemark <jdenemar@redhat.com>
Wed, 28 May 2025 14:37:32 +0000 (16:37 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 2 Jun 2025 08:03:08 +0000 (10:03 +0200)
commit94fb348d670f612c0b58901c9829b4eec81faa50
tree3fd0486002698753012240da991257cd691b6518
parent05526b50909ff50c16e13a0b5580d41de74e3d59
util: Fix virFileIsSharedFSOverride on nonexistent paths

Commit v11.0.0-162-gf2023e8018 added path canonicalization to
virFileIsSharedFSOverride to make sure we can properly match shared
filesystem override paths which include symlinks. But
virFileCanonicalizePath only works on existing paths, while
virFileIsSharedFSOverride may be called on paths that do not exist yet.
Matching paths against overrides has always worked even for nonexistent
paths. To fix the regression we need to first get the longest existing
sub-path and canonicalize only this part and use the result for
searching in overrides. Clearly any portion of the path we dynamically
create is not going to end up on a different filesystem to what the
parent directory is stored in. So checking just the existing parent is
enough.

https://issues.redhat.com/browse/RHEL-86592

Fixes: f2023e8018fe18550ad6aec66fe72bd1376f8522
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virfile.c