From 60960d2405f513b9b7a7abb2c00c535c471524a8 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 18 Oct 2024 19:27:42 +0200 Subject: [PATCH] fs/vss: properly create node from vss path Previously, NodeFromFileInfo used the original file path to create the node, which also meant that extended metadata was read from there instead of within the vss snapshot. --- internal/fs/fs_local_vss.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/fs/fs_local_vss.go b/internal/fs/fs_local_vss.go index 908e744ee..54139ab2e 100644 --- a/internal/fs/fs_local_vss.go +++ b/internal/fs/fs_local_vss.go @@ -10,6 +10,7 @@ import ( "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/options" + "github.com/restic/restic/internal/restic" ) // VSSConfig holds extended options of windows volume shadow copy service. @@ -140,6 +141,10 @@ func (fs *LocalVss) Lstat(name string) (os.FileInfo, error) { return os.Lstat(fs.snapshotPath(name)) } +func (fs *LocalVss) NodeFromFileInfo(path string, fi os.FileInfo, ignoreXattrListError bool) (*restic.Node, error) { + return fs.FS.NodeFromFileInfo(fs.snapshotPath(path), fi, ignoreXattrListError) +} + // isMountPointIncluded is true if given mountpoint included by user. func (fs *LocalVss) isMountPointIncluded(mountPoint string) bool { if fs.excludeVolumes == nil {