dimo414 / bash-cache

Transparent caching layer for bash functions; particularly useful for functions invoked as part of your prompt.
GNU General Public License v3.0
73 stars 4 forks source link

Secure cache contents and support isolated caches #6

Closed dimo414 closed 6 years ago

dimo414 commented 6 years ago

Original report by Michael Diamond (Bitbucket: dimo414).


As pointed out in #5 concurrent invocations could collide. For a single-user system trying to cache their prompt this is actually beneficial (since separate shell sessions can reuse the same cached data), but is undesirable in the general case. Need to:

  1. Ensure that cached data can't be written or read by other users, which also suggests cache dirs should be separate per user to avoid collisions
  2. Provide a way to either manually set the cache dir or to namespace the cache (which under the covers would use a separate dir)
dimo414 commented 6 years ago

Original comment by Michael Diamond (Bitbucket: dimo414).


Addressed 1. in a152290b

dimo414 commented 6 years ago

Original comment by Michael Diamond (Bitbucket: dimo414).


Introduce BC_CACHE_DIR to support custom cache directories, resolves #6. Also expanded README docs.