Skip to content

Commit c7aede9

Browse files
committed
Fix file.managed error prefix and redact basic-auth in source_hash errors
Forward-port from 3008.x commit 3fafbbe to master: - salt/states/file.py: prefix the early `_error()` return in `file.managed` with "Unable to manage file:" so callers and tests can reliably distinguish the manage-file failure path from other state errors. Restores the assertion checked by tests/pytests/functional/states/file/test_managed.py::test_issue_60203, which is failing across every functional-zeromq-3 chunk on master. - salt/modules/file.py: route the `source_hash` value through `salt.utils.url.redact_http_basic_auth()` in both the "format is invalid" and "Source hash file not found" error paths of `get_source_sum()` so HTTP basic-auth credentials are not leaked into state comments or logs when the source hash URI is malformed or unreachable.
1 parent 1f718c4 commit c7aede9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

changelog/69402.fixed.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Prefix ``file.managed`` error comments with ``Unable to manage file:`` and
2+
redact HTTP basic-auth credentials from ``Source hash`` error messages in
3+
``salt.modules.file.get_source_sum`` so they are not leaked in state output
4+
or logs.

0 commit comments

Comments
 (0)