mirror of
https://github.com/9001/copyparty.git
synced 2026-04-01 04:53:10 +10:00
be case-sensitive on windows/macos (closes #781);
on Windows and Macos, most filesystems are case-insensitive, which can lead to dangerous situations one example is when another program (not copyparty or its UI) wants to rename a file from `Foo` to `foo`; the program will probably start by checking if `foo` exists and then delete it, however this would match `Foo` and confuse the program into deleting the wrong file fix this by adding a VERY EXPENSIVE detector to prevent this, by listing the parent folder and checking if the case matches this check will auto-enable when a case-insensitive FS is detected on startup, but option `casechk` (global or volflag) can override this
This commit is contained in:
@@ -735,6 +735,9 @@ class HttpCli(object):
|
||||
else:
|
||||
avn = vn
|
||||
|
||||
if "bcasechk" in vn.flags and not vn.casechk(rem, True):
|
||||
return self.tx_404() and False
|
||||
|
||||
(
|
||||
self.can_read,
|
||||
self.can_write,
|
||||
|
||||
Reference in New Issue
Block a user