From 26e18ae8008478ea374a40406d47c162f36fad4e Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 12 May 2021 23:22:43 +0200 Subject: [PATCH] disallow uploading logues --- copyparty/httpcli.py | 4 +++- copyparty/szip.py | 2 +- copyparty/up2k.py | 2 +- copyparty/util.py | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index d1816f96..e1d1d0d6 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -741,7 +741,9 @@ class HttpCli(object): if p_file and not nullwrite: fdir = os.path.join(vfs.realpath, rem) - fname = sanitize_fn(p_file) + fname = sanitize_fn( + p_file, bad=[".prologue.html", ".epilogue.html"] + ) if not os.path.isdir(fsenc(fdir)): raise Pebkac(404, "that folder does not exist") diff --git a/copyparty/szip.py b/copyparty/szip.py index 1a3d360b..d3e5c088 100644 --- a/copyparty/szip.py +++ b/copyparty/szip.py @@ -87,7 +87,7 @@ def gen_hdr(h_pos, fn, sz, lastmod, utf8, crc32, pre_crc): ret += struct.pack("