Skip to content

logging: Add regression coverage for rotated file mode#7620

Merged
steadytao merged 2 commits intocaddyserver:masterfrom
steadytao:test/logging-rotation-mode-regression
Apr 26, 2026
Merged

logging: Add regression coverage for rotated file mode#7620
steadytao merged 2 commits intocaddyserver:masterfrom
steadytao:test/logging-rotation-mode-regression

Conversation

@steadytao
Copy link
Copy Markdown
Member

Adds Caddy-side regression coverage for the log rotation mode issue addressed by the timberjack bump in #7618.

Why

Issue #7613 reported that after log rotation, the new active log file could lose permissions configured via mode because the process umask still masked bits during rotation-time file creation.

The behavioral fix belongs in github.com/DeRuina/timberjack and was brought into Caddy by #7618, which bumps timberjack to v1.4.1.

This PR does not change Caddy runtime behavior. It adds regression coverage to ensure Caddy’s integration continues to preserve the configured file mode across rotation under a nonzero umask.

What this tests

The new test exercises the user-facing behavior from #7613:

  • umask set to 0022
  • rolling file logs enabled
  • configured file mode 0660
  • rotation triggered
  • asserts that the new active log file still has mode 0660

Related

Assistance Disclosure

No AI was used.

Copy link
Copy Markdown
Member

@francislavoie francislavoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, needs a rebase to fix go.mod then we can merge.

@steadytao steadytao merged commit fdbef2a into caddyserver:master Apr 26, 2026
25 checks passed
@steadytao steadytao deleted the test/logging-rotation-mode-regression branch April 26, 2026 13:30
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.

2 participants