-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
This is a comment on #2329:
It seems like $TMPDIR is only system-wide on Linux. Both macOS and Windows have a user-specific temp.
So, for Linux, can you help me understand why we are using an error prone approach where /tmp/.net (with a predictable name, susceptible to collisions and other attacks) is used? Wouldn't it be more secure to fall back to a user-specific path? $XDG_CACHE_HOME (falling back to $HOME/.cache/) seems like a location that would be much less susceptible attacks and accidental clashes.
Also, most recent distributions treat /tmp as temporary. systemd, for example, wipes things older than 10 days on /tmp/ on my machine. Compare this with the persistent $HOME/.cache. On the other hand, if we want things cleaned up, using the more secure /run/user/$UID (created on user login, secure without races) seems like the better way to go.
cc @tmds @swaroop-sridhar @jkotas @lpereira @danmosemsft