]> git.ipfire.org Git - thirdparty/libvirt.git/commit
utils: Canonicalize paths before comparing them
authorAndrea Bolognani <abologna@redhat.com>
Thu, 13 Feb 2025 08:54:05 +0000 (09:54 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 17 Feb 2025 17:30:35 +0000 (18:30 +0100)
commitf2023e8018fe18550ad6aec66fe72bd1376f8522
tree4511e88c74d06c47bc6214428638a08b8aa82ae5
parentb5dfcdc7ab9091e0a4467036a35e0dd9bbd64c8d
utils: Canonicalize paths before comparing them

In virFileIsSharedFSOverride() we compare a path against a list
of overrides looking for a match.

All overrides are canonicalized ahead of time though, so e.g.
/var/run/foo will be turned into /run/foo due to /var/run being
a symlink on modern Linux systems. But the path we're trying to
match with the overrides doesn't get the same treatment, so in
this scenario the comparison will always fail.

Canonicalizing the path as well solves the issue.

Resolves: https://issues.redhat.com/browse/RHEL-79165
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virfile.c