From 2cca6e0922ef88d956fa9c58bdf830dd57d1826b Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 12 May 2023 21:38:16 +0000 Subject: [PATCH] warn when sharing certain system locations --- copyparty/authsrv.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index e49971b7..fac29b9a 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -1581,6 +1581,12 @@ class AuthSrv(object): if t: self.log("\n\033[{}\033[0m\n".format(t)) + zv, _ = vfs.get("/", "*", False, False) + zs = zv.realpath.lower() + if zs in ("/", "c:\\") or zs.startswith(r"c:\windows"): + t = "you are sharing a system directory: {}\n" + self.log(t.format(zv.realpath), c=1) + try: zv, _ = vfs.get("/", "*", False, True) if self.warn_anonwrite and os.getcwd() == zv.realpath: