From d9046f7e01ae182fcb827c6628b5f2cfe2ee462d Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 16 Aug 2025 21:55:51 +0000 Subject: [PATCH] fix xvol false-positive; given the following config: * volume /a mapped to /srv/nas/ * volume /b mapped to /srv/nas/foo/ * anyone can read volume /a but not /b accessing /a/foo/ would incorrectly fail because the xvol-check would select /b based on its abspath being physically closer, not considering that the same abspath is reachable from /a --- copyparty/authsrv.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 5329ede1..f5f5c223 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -881,6 +881,15 @@ class VFS(object): return None if "xvol" in self.flags: + self_ap = self.realpath + os.sep + if aps.startswith(self_ap): + vp = aps[len(self_ap) :] + if ANYWIN: + vp = vp.replace(os.sep, "/") + vn2, _ = self._find(vp) + if self == vn2: + return self + all_aps = self.shr_all_aps or self.root.all_aps for vap, vns in all_aps: