From nobody Mon Oct 20 16:09:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cr0jl0xXHz6CgB9; Mon, 20 Oct 2025 16:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cr0jk6b8vz3RJw; Mon, 20 Oct 2025 16:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760976554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHEnt7dhrnDuc6ovUg2uSOCVpROGdfz1rv1Z3fR5c3g=; b=B8JNArBWk5xsF5ZgoOZZGS/Fj1PwD7s4fX1IbSA6Ev+Jil62c7jUHdkVv2z/QcMktPucq8 dpCGPyG2Rf18b0QXEQRz0CJrCOfCEbKXZreIWm6XVGhxfad3dwbEE/JEVTx7yzdaXkHta5 lzvyTq0PG9Lf9lPSsIjrgiO3oNqnrcXWgK7oNSEiJKwk03reun8e3ek9udPXJiwX8W5UJV ahF0eLasFEdq8HroD0v2WN6fw9t64Fg33np7fMcMv1dPTVqBImjvYshwJApz0xpnByO0m+ p55CCCP0e4ldPwQ9fvLRS+CmH1LEFmabNGO5KOAhhCn7q9L2CTJ8UxI5QJWU7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760976554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHEnt7dhrnDuc6ovUg2uSOCVpROGdfz1rv1Z3fR5c3g=; b=hgla3qmPsxsSNsi6Q6kpxBlAGqkBH9Hc6mL166z7lcLFBgXHDKET7J4d1kHm/AcBEXLCXx Fwdxwhy5XZuRJlONY0RkXqi8PDwp6Mm6MPuxEjF4TovnL9/KTZ3Dl6TB4F0JkiJdhEnylS Xl0StVG1hwHHUuo+NiXzGE9YzpV1ZUCQIvcg656KfbAO+00X1cIz/poSsyCdWfInV2egYi g1I/XU2FbPIayY85tA+lq1EJ0JG+WXHPJMMtEvXoL8UuxUxzvVRt+y55o9IBLY92dlyZoF j8CM0jtQqTM8CSHTDnKCI5dybJZKCe4T4ADTN1oR7lL0eLw0l2uTSbZX3Zz+8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760976554; a=rsa-sha256; cv=none; b=dPEIuKgJK4B3Uj6Yi5UMxRytFmoLvNPpWcrTDb4EbbGSRHdiz6cGU/9lSwpgr2ANIUYMRS a47hN+fFZGPtPmh9Z4VCWz7gfaySAq0olkckGqNHLnbX8XAIbkyv46YU4oZVmXw6jZ2lK5 xpap4nPAc2VzEhTQc7qld6NTe8H/ONaraGbAtoEbA3HxLyRVJAL14pEnNBuzBjqbmxTHGz 7T6q202kpBc6K1XAlIejR423xCje6GEaPoNFmoeg2c4lItc/CayMtuzTmVyhOIkjkPp++k wmnmnBMUIUM25fGPQI8zNiAHpvkiMpKZuUk/4HWc4EEFmclbJT3rjG4T4qmMlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cr0jk69B7z4JN; Mon, 20 Oct 2025 16:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59KG9Egv024306; Mon, 20 Oct 2025 16:09:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59KG9E6w024303; Mon, 20 Oct 2025 16:09:14 GMT (envelope-from git) Date: Mon, 20 Oct 2025 16:09:14 GMT Message-Id: <202510201609.59KG9E6w024303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: fa2e886206f4 - stable/15 - rc: dmesg: Allow umask to be configurable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fa2e886206f41b4ce652377a6da163103ef25351 Auto-Submitted: auto-generated The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=fa2e886206f41b4ce652377a6da163103ef25351 commit fa2e886206f41b4ce652377a6da163103ef25351 Author: Jose Luis Duran AuthorDate: 2025-10-17 14:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-10-20 16:04:35 +0000 rc: dmesg: Allow umask to be configurable Allow 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 Reviewed by: netchild MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D53169 (cherry picked from commit edadbc6ee95570627679f3bc14a1d5476d0ce339) --- libexec/rc/rc.conf | 1 + libexec/rc/rc.d/dmesg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 87f9d50b3b3c..2b6db04d08e3 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -707,6 +707,7 @@ osrelease_enable="YES" # Update /var/run/os-release on boot (or NO). osrelease_file="/var/run/os-release" # File to update for os-release. osrelease_perms="444" # Default permission for os-release file. dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot +dmesg_umask="022" # Default umask for /var/run/dmesg.boot file. watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) watchdogd_timeout="" # watchdogd timeout, overrides -t in watchdogd_flags diff --git a/libexec/rc/rc.d/dmesg b/libexec/rc/rc.d/dmesg index 51e35d5d4e80..736449f3b159 100755 --- a/libexec/rc/rc.d/dmesg +++ b/libexec/rc/rc.d/dmesg @@ -19,7 +19,7 @@ stop_cmd=":" do_dmesg() { rm -f ${dmesg_file} - ( umask 022 ; /sbin/dmesg $rc_flags > ${dmesg_file} ) + ( umask "${dmesg_umask}" ; /sbin/dmesg $rc_flags > ${dmesg_file} ) } load_rc_config $name