fix(system_baseline): accept every size journald reads for the journal cap #449

Merged
Defame1297 merged 1 commits from fix/journal-max-use-syntax into main 2026-11-27 21:33:53 +00:00
Owner

What and why

Follow-up to #415 (#401), before it ships in a release.

The system_baseline_journal_max_use check that #415 added refused sizes journald accepts. Those were a bare byte count, 1.5G, 10 M, 0, and the P, E and B units, and 3.1.0 wrote all of them as given. Shipping that would break consumers in a minor release. The check also accepted infinity, but SystemMaxUse does not take it: it uses config_parse_iec_uint64, not the _infinity variant, so journald logs a parse error and ignores the value.

The check now follows journald's parse_size(): a number, an optional fraction, an optional space and an optional upper-case B, K, M, G, T, P or E, with compound terms such as 1G512M allowed. A line break is still refused, so the value cannot inject a second directive. The argument spec, README, verify refusals and the unreleased 401 fragment are updated to match.

Verified

  • I ran the real assert from tasks/validate.yml locally against 23 values.
    • Accepted: 200M, 2G, 300, 0, 1.5G, 10.M, 10 M, 1G512M, 1G 512M, 1T, 5P, 100B and the empty string.
    • Refused: infinity, 10m, 10MB, 10 M (trailing space), abc, a value with a line break, -1M, 1.2.3G and the integer 300.
  • The accepted syntax was checked against systemd's source: journald-gperf.gperf maps SystemMaxUse to config_parse_iec_uint64, which calls parse_size() in parse-util.c.
  • pre-commit run on the changed files passed every hook except ansible-lint.

Not verified

  • I skipped ansible-lint locally: the hook lints the whole collection and was too slow on a loaded machine. The Lint check runs it.
  • I skipped the pre-push ansible-test sanity run, for the same reason. The Build check runs it.
  • I have not run Molecule locally. The system_baseline scenario runs in CI.
  • 1M1G (increasing units) passes the check but journald rejects it. It is a single line that journald logs and ignores, so it is harmless. Catching it would make the regex much harder to review.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Follow-up to #415 (#401), before it ships in a release. The `system_baseline_journal_max_use` check that #415 added refused sizes journald accepts. Those were a bare byte count, `1.5G`, `10 M`, `0`, and the `P`, `E` and `B` units, and 3.1.0 wrote all of them as given. Shipping that would break consumers in a minor release. The check also accepted `infinity`, but `SystemMaxUse` does not take it: it uses `config_parse_iec_uint64`, not the `_infinity` variant, so journald logs a parse error and ignores the value. The check now follows journald's `parse_size()`: a number, an optional fraction, an optional space and an optional upper-case `B`, `K`, `M`, `G`, `T`, `P` or `E`, with compound terms such as `1G512M` allowed. A line break is still refused, so the value cannot inject a second directive. The argument spec, README, verify refusals and the unreleased `401` fragment are updated to match. ## Verified - I ran the real assert from `tasks/validate.yml` locally against 23 values. - Accepted: `200M`, `2G`, `300`, `0`, `1.5G`, `10.M`, `10 M`, `1G512M`, `1G 512M`, `1T`, `5P`, `100B` and the empty string. - Refused: `infinity`, `10m`, `10MB`, `10 M ` (trailing space), `abc`, a value with a line break, `-1M`, `1.2.3G` and the integer `300`. - The accepted syntax was checked against systemd's source: `journald-gperf.gperf` maps `SystemMaxUse` to `config_parse_iec_uint64`, which calls `parse_size()` in `parse-util.c`. - `pre-commit run` on the changed files passed every hook except ansible-lint. ## Not verified - I skipped ansible-lint locally: the hook lints the whole collection and was too slow on a loaded machine. The Lint check runs it. - I skipped the pre-push `ansible-test sanity` run, for the same reason. The Build check runs it. - I have not run Molecule locally. The `system_baseline` scenario runs in CI. - `1M1G` (increasing units) passes the check but journald rejects it. It is a single line that journald logs and ignores, so it is harmless. Catching it would make the regex much harder to review. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added 1 commit 2026-11-27 21:26:31 +00:00
fix(system_baseline): accept every size journald reads for the journal cap
Build / build (pull_request) Successful in 48s
Lint / lint (pull_request) Successful in 2m47s
Molecule / molecule (pull_request) Successful in 6m7s
985995656a
The new check on system_baseline_journal_max_use refused sizes journald
accepts (a bare byte count, 1.5G, 10 M, P and E units), which 3.1.0
wrote as given, and accepted infinity, which SystemMaxUse does not take.
The check now follows journald's parse_size(): a number with an
optional upper-case B, K, M, G, T, P or E, still with no line break.

Assisted-by: Claude Code
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-27 21:33:14 +00:00
Defame1297 merged commit 30a8e71f97 into main 2026-11-27 21:33:53 +00:00
Defame1297 deleted branch fix/journal-max-use-syntax 2026-11-27 21:33:55 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#449