Skip to content

fix(logs): preserve subdirectory components in _validate_log_path (#2194)#2283

Closed
mrveiss wants to merge 1 commit intoDev_new_guifrom
fix/issue-2194-log-path
Closed

fix(logs): preserve subdirectory components in _validate_log_path (#2194)#2283
mrveiss wants to merge 1 commit intoDev_new_guifrom
fix/issue-2194-log-path

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Mar 24, 2026

Summary

  • Fix _validate_log_path which used Path(file_path).name, silently dropping subdirectory components
  • backend/app.log was resolving to app.log instead of LOG_DIR/backend/app.log
  • Now handles both relative paths and absolute paths (strips LOG_DIR prefix)
  • Path traversal protection still enforced via validate_relative_path

Test plan

  • Relative subdir paths preserved: backend/app.logLOG_DIR/backend/app.log
  • Absolute paths handled: LOG_DIR/backend/app.log → strips prefix correctly
  • Path traversal still rejected: ../etc/passwd → error
  • Syntax verified, pre-commit hooks pass

Closes #2194

🤖 Generated with Claude Code

)

Path(file_path).name was silently dropping subdirectory components,
causing nested log file requests to resolve to wrong paths.
@github-actions
Copy link
Copy Markdown

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss
Copy link
Copy Markdown
Owner Author

mrveiss commented Mar 24, 2026

Closing in favor of PR #2285 which uses a cleaner approach (fixes callers + validator together).

@mrveiss mrveiss closed this Mar 24, 2026
@mrveiss mrveiss deleted the fix/issue-2194-log-path branch March 24, 2026 20:16
@mrveiss
Copy link
Copy Markdown
Owner Author

mrveiss commented Mar 24, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant