saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.2k stars 5.48k forks source link

[3006.x] Constrain the localfs cache to the cachedir #67033

Open lkubb opened 2 weeks ago

lkubb commented 2 weeks ago

What does this PR do?

Constrain the localfs cache module to its cachedir.

What issues does this PR fix or reference?

Fixes: https://github.com/saltstack/salt/issues/67031

Previous Behavior

Operates on the whole filesystem when bank (or key) is prefixed with os.sep

New Behavior

Only operates on subpaths of cachedir.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

twangboy commented 1 week ago

Once we get the test suite fixed we'll need you to rebase so the tests can run.