mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
make thumb-dir.txt unretrievable
This commit is contained in:
parent
456f575637
commit
1e27a4c2df
|
@ -242,6 +242,10 @@ class VFS(object):
|
||||||
if flt:
|
if flt:
|
||||||
flt = {k: True for k in flt}
|
flt = {k: True for k in flt}
|
||||||
|
|
||||||
|
f1 = "{0}.hist{0}up2k.".format(os.sep)
|
||||||
|
f2a = os.sep + "dir.txt"
|
||||||
|
f2b = "{0}.hist{0}".format(os.sep)
|
||||||
|
|
||||||
for vpath, apath, files, rd, vd in self.walk(
|
for vpath, apath, files, rd, vd in self.walk(
|
||||||
"", vrem, [], uname, dots, scandir, False
|
"", vrem, [], uname, dots, scandir, False
|
||||||
):
|
):
|
||||||
|
@ -275,7 +279,11 @@ class VFS(object):
|
||||||
del vd[x]
|
del vd[x]
|
||||||
|
|
||||||
# up2k filetring based on actual abspath
|
# up2k filetring based on actual abspath
|
||||||
files = [x for x in files if "{0}.hist{0}up2k.".format(os.sep) not in x[1]]
|
files = [
|
||||||
|
x
|
||||||
|
for x in files
|
||||||
|
if f1 not in x[1] and (not x[1].endswith(f2a) or f2b not in x[1])
|
||||||
|
]
|
||||||
|
|
||||||
for f in [{"vp": v, "ap": a, "st": n[1]} for v, a, n in files]:
|
for f in [{"vp": v, "ap": a, "st": n[1]} for v, a, n in files]:
|
||||||
yield f
|
yield f
|
||||||
|
|
|
@ -1561,7 +1561,9 @@ class HttpCli(object):
|
||||||
raise Pebkac(404)
|
raise Pebkac(404)
|
||||||
|
|
||||||
if self.readable:
|
if self.readable:
|
||||||
if rem.startswith(".hist/up2k."):
|
if rem.startswith(".hist/up2k.") or (
|
||||||
|
rem.endswith("/dir.txt") and rem.startswith(".hist/th/")
|
||||||
|
):
|
||||||
raise Pebkac(403)
|
raise Pebkac(403)
|
||||||
|
|
||||||
is_dir = stat.S_ISDIR(st.st_mode)
|
is_dir = stat.S_ISDIR(st.st_mode)
|
||||||
|
|
Loading…
Reference in a new issue