From 738a419b2be326ba990007c430b76150597191f6 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 9 Jan 2026 00:29:44 +0000 Subject: [PATCH] append: only allow with reflink or !dedup; un-dedup of target file is likely too expensive, and relying on up2k.db to do it conditionally too dangerous --- copyparty/authsrv.py | 7 +++++++ copyparty/httpcli.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index ce782bc3..da944eb8 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -2650,6 +2650,13 @@ class AuthSrv(object): self.log(t, 1) raise Exception(t) + if ( + "dedup" in vol.flags + and "reflink" not in vol.flags + and vol.flags["apnd_who"] != "no" + ): + vol.flags["apnd_who"] = "ndd" + # verify tags mentioned by -mt[mp] are used by -mte local_mtp = {} local_only_mtp = {} diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index e58867c4..a9fec2ec 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2553,6 +2553,8 @@ class HttpCli(object): or (zs == "dw" and self.can_delete) ): pass + elif zs == "ndd": + raise Pebkac(400, "append is denied here due to non-reflink dedup") else: raise Pebkac(400, "you do not have permission to append") zs = os.path.join(params["fdir"], fn)