Skip to content

Commit

Permalink
repo: site_cache_dir: isolate by user
Browse files Browse the repository at this point in the history
Related #9249
  • Loading branch information
efiop committed Apr 2, 2023
1 parent ecdc44e commit 7cdb3b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dvc/repo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ def dvcfs(self) -> "DVCFileSystem":

@cached_property
def site_cache_dir(self) -> str:
import getpass
import hashlib

import platformdirs
Expand All @@ -583,7 +584,9 @@ def site_cache_dir(self) -> str:
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)

Expand Down

0 comments on commit 7cdb3b0

Please sign in to comment.