Skip to content

journal: fix two recent regressions in config handling#39069

Merged
yuwata merged 2 commits intosystemd:mainfrom
yuwata:journald-fix-regressions-in-config-handling
Sep 22, 2025
Merged

journal: fix two recent regressions in config handling#39069
yuwata merged 2 commits intosystemd:mainfrom
yuwata:journald-fix-regressions-in-config-handling

Conversation

@yuwata
Copy link
Member

@yuwata yuwata commented Sep 22, 2025

Fixes #39046.
Fixes #39057.

<listitem><para>Takes a boolean value or special value <literal>keep</literal>. If enabled
<command>systemd-journald</command> will turn on kernel auditing on start-up. If disabled it will
turn it off. When <literal>keep</literal> it will neither enable nor disable it, leaving the previous
state unchanged. This means if another tool turns on auditing even if
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this bit to the docs! I think it's a great addition

static const char* const audit_set_mode_table[_AUDIT_SET_MODE_MAX] = {
[AUDIT_DISABLE] = "no",
[AUDIT_ENABLE] = "yes",
[AUDIT_KEEP] = "keep",
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes this is way nicer than the empty string!

@YHNdnzj YHNdnzj added good-to-merge/with-minor-suggestions and removed please-review PR is ready for (re-)review by a maintainer labels Sep 22, 2025
Otherwise, SplitMode= in journald.conf is always ignored.

Fixes a regression caused by f48cf2a (v258).
Fixes systemd#39046.
In systemd <= 257, each set_audit tristate value had special meaning,
- true: enable the kernel audit subsystem,
- false: disable the kernel audit subsystem,
- negative: keep the current kernel audit subsystem state.

And the default is true, rather than negative. So, users sometimes
explicitly pass an empty string to Audit= setting to keep the state.

But since f48cf2a (v258), the negative
value is mistakenly used as 'really unspecified' even if an empty string
is explicitly specified.

This makes negative values handled as unspecified as usual, and assign a new
positive value AUDIT_KEEP for when an empty string is explicitly specified.
Also, make the Audit= setting accept "keep" setting, and suggest to use "keep"
rather than an empty string.

Fixes a regression caused by f48cf2a (v258).
Fixes systemd#39057.
@yuwata yuwata force-pushed the journald-fix-regressions-in-config-handling branch from 78ff191 to b5fdfed Compare September 22, 2025 14:07
@yuwata
Copy link
Member Author

yuwata commented Sep 22, 2025

@arianvp @YHNdnzj @poettering Thank you for the review and comments. All requests are addressed. Upgrading the green label.

@yuwata yuwata added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed good-to-merge/with-minor-suggestions labels Sep 22, 2025
@yuwata yuwata merged commit 6c3c7a8 into systemd:main Sep 22, 2025
51 of 56 checks passed
@yuwata yuwata deleted the journald-fix-regressions-in-config-handling branch September 22, 2025 17:43
@github-actions github-actions bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Sep 22, 2025
ElvishJerricco added a commit to NixOS/nixpkgs that referenced this pull request Oct 3, 2025
@keszybz
Copy link
Member

keszybz commented Oct 10, 2025

I queued this up for v258.1, but there's a lot of conflicts for v257-stable. I'm leaving it out for now.

@arianvp
Copy link
Contributor

arianvp commented Oct 10, 2025

Neither of these bugs were present in 257. I think they were both introduced by a refactor that took place in 258. So I don't think there is a need for backport to 257

@keszybz
Copy link
Member

keszybz commented Oct 10, 2025

Oh, you're right. The second patch says '<= 257' and I misinterpreted that. So indeed, this doesn't need further backporting.

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

5 participants