From e3ead3ba0a7a35716b6ea95b605d7440813eadd5 Mon Sep 17 00:00:00 2001 From: Roman Vanicek Date: Thu, 3 Oct 2024 14:20:03 +0200 Subject: [PATCH] Be more lenient with matching the ObjectiveFs mount path --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 45d0583..6725f4e 100644 --- a/main.go +++ b/main.go @@ -814,12 +814,13 @@ func getMountedSnaphots(baseDir string, checkMount bool) (map[string]string, err } func isObjectiveFsMount(path string) (bool, error) { + nameToMatch := filepath.Base(path) mount := exec.Command("df", "--output=target", "-t", "fuse.objectivefs", path) if data, err := mount.CombinedOutput(); err == nil { scanner := bufio.NewScanner(strings.NewReader(string(data))) // On success the first line contains column headers (in our case "Mounted on") // and the second line contains the nearest mount point on the root path - return scanner.Scan() && scanner.Scan() && strings.TrimSpace(scanner.Text()) == path, nil + return scanner.Scan() && scanner.Scan() && filepath.Base(strings.TrimSpace(scanner.Text())) == nameToMatch, nil } else { return false, err }