Context
std_register_cleanup_path validates all provided paths before registering any of them. If one path is unsafe, the function returns 1 immediately and none of the valid paths from that call are registered.
This all-or-nothing behavior may be intentional, but it is not explicit enough in the public contract and can surprise callers that pass mixed cleanup paths.
Failure Scenario
std_register_cleanup_path "$good_tmpdir" "/" "$also_good_tmpdir"
The function rejects / and returns 1. Neither valid temp path is registered for cleanup. The error names the unsafe path but does not make the batch semantics clear.
Scope
- Decide whether cleanup path batch registration should be all-or-nothing or best-effort per path.
- Implement the chosen behavior consistently.
- Document the behavior in
lib/bash/std/README.md and function comments.
- Add BATS coverage for mixed valid and unsafe cleanup path arguments.
Acceptance Criteria
- Mixed valid/unsafe cleanup path calls have documented behavior.
- Tests prove whether valid paths are registered or skipped when the batch contains an unsafe path.
- Existing dangerous-path protections remain intact.
./tests/validate.sh passes.
Validation
Context
std_register_cleanup_pathvalidates all provided paths before registering any of them. If one path is unsafe, the function returns 1 immediately and none of the valid paths from that call are registered.This all-or-nothing behavior may be intentional, but it is not explicit enough in the public contract and can surprise callers that pass mixed cleanup paths.
Failure Scenario
The function rejects
/and returns 1. Neither valid temp path is registered for cleanup. The error names the unsafe path but does not make the batch semantics clear.Scope
lib/bash/std/README.mdand function comments.Acceptance Criteria
./tests/validate.shpasses.Validation
./tests/validate.sh