repo: site_cache_dir: isolate by user

Related #9249
This commit is contained in:
Ruslan Kuprieiev
2023-04-03 00:29:44 +03:00
parent ecdc44e010
commit 7cdb3b0ae2
+4 -1
View File
@@ -558,6 +558,7 @@ class Repo:
@cached_property
def site_cache_dir(self) -> str:
import getpass
import hashlib
import platformdirs
@@ -583,7 +584,9 @@ class Repo:
finally:
os.umask(umask)
repo_token = hashlib.md5(os.fsencode(root_dir)).hexdigest() # noqa: S324
repo_token = hashlib.md5( # noqa: S324
str((root_dir, getpass.getuser())).encode()
).hexdigest()
return os.path.join(repos_dir, repo_token)