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
This commit is contained in:
ed 2026-01-09 00:29:44 +00:00
parent 3a16d3461d
commit 738a419b2b
2 changed files with 9 additions and 0 deletions

View file

@ -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 = {}

View file

@ -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)