From 2b50fc20105966b54ce3e9296d86db5b2a2caae0 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 6 Apr 2025 09:18:40 +0000 Subject: [PATCH] fix mkdir in symlinked folders; closes #151 remove an overly careful safety-check which would refuse creating directories if the location was outside of the volume's base-path it is safe to trust `rem` due to `vpath = undot(vpath)` and a similar check being performed inside `vfs.get` as well, so this served no purpose --- copyparty/httpcli.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index d9b1fd21..c3ed6783 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2999,9 +2999,6 @@ class HttpCli(object): vfs, rem = self.asrv.vfs.get(vpath, self.uname, False, True) rem = sanitize_vpath(rem, "/") fn = vfs.canonical(rem) - if not fn.startswith(vfs.realpath): - self.log("invalid mkdir %r %r" % (self.gctx, vpath), 1) - raise Pebkac(422) if not nullwrite: fdir = os.path.dirname(fn)