Page MenuHomeFreeBSD

rc: dmesg: Allow file and umask to be configurable
ClosedPublic

Authored by jlduran on Oct 17 2025, 4:39 PM.
Tags
None
Referenced Files
F142187393: D53169.id164503.diff
Fri, Jan 16, 11:59 PM
Unknown Object (File)
Sat, Jan 10, 12:07 PM
Unknown Object (File)
Sat, Jan 10, 5:19 AM
Unknown Object (File)
Tue, Dec 30, 12:04 PM
Unknown Object (File)
Thu, Dec 18, 2:07 PM
Unknown Object (File)
Dec 14 2025, 7:13 PM
Unknown Object (File)
Dec 11 2025, 4:27 AM
Unknown Object (File)
Dec 6 2025, 3:16 PM
Subscribers

Details

Summary

Allow file, and umask to be configurable.

Being able to set the umask via an rc variable is useful when setting:

security.bsd.unprivileged_read_msgbuf=0

As it allows a user to configure:

dmesg_umask="066"

Without modifying the rc script, and preventing the contents of the
$dmesg_file (/var/run/dmesg.boot) from being publicly readable.

PR: 272552

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jlduran added inline comments.
libexec/rc/rc.d/dmesg
15

I can leave this part of the patch intact, without the user being able to change the dmesg_file via rc.conf.
My main focus is on setting the umask before creating the file (with an rc variable).

netchild added a subscriber: netchild.

The umask part looks fine.
About the dmesg_file part: from a technical point of view it is ok.,From a feature point of view, if it is not necessary, don't change it (I can't remember to have seen someone to have asked in the last 20 years about having it in another location).

This revision is now accepted and ready to land.Oct 18 2025, 2:00 PM

The umask part looks fine.
About the dmesg_file part: from a technical point of view it is ok.,From a feature point of view, if it is not necessary, don't change it (I can't remember to have seen someone to have asked in the last 20 years about having it in another location).

Thank you, good advice! Will do so when committing.

This revision was automatically updated to reflect the committed changes.