Thread View: muc.lists.freebsd.bugs
5 messages
5 total messages
Started by bugzilla-noreply
Thu, 15 Oct 2026 14:07
[Bug 299413] sysrc fails with $
Author: bugzilla-noreply
Date: Thu, 15 Oct 2026 14:07
Date: Thu, 15 Oct 2026 14:07
39 lines
2963 bytes
2963 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299413
Bug ID: 299413
Summary: sysrc fails with $
Product: Base System
Version: 14.5-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: bugs@FreeBSD.org
Reporter: julien@perdition.city
Hello,
It looks like sysrc is failing in check mode when a "$" is involved:
lambic% grep cron_flags /jails/webapps/etc/rc.conf
cron_flags="$cron_flags -J 15"
lambic% sysrc -f /jails/webapps/etc/rc.conf -c -v 'cron_flags=$cron_flags -J
15'
/jails/webapps/etc/rc.conf: cron_flags: would change from ` -J 15' to
`$cron_flags -J 15'
Thanks!
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 299413] sysrc fails with $
Author: bugzilla-noreply
Date: Sat, 14 Nov 2026 17:55
Date: Sat, 14 Nov 2026 17:55
42 lines
3626 bytes
3626 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299413
--- Comment #1 from Kushagra Chauhan <zenzesama@gmail.com> ---
Hi,
I reproduced this with the sysrc and sysrc.subr from current main, and
read the code in usr.sbin/sysrc/sysrc and sysrc.subr.
The cause is in the plain-assignment case. "before" comes from
f_sysrc_get, which sources the rc.conf files in a subshell and returns
the expanded value. "new" is the raw text from the command line
(${1#*=}). The -c check then does [ "$new" != "$before" ]. With
cron_flags="$cron_flags -J 15" in the file, before is " -J 15" and new
is "$cron_flags -J 15", so they can never match.
Before c97460c4d97d (PR 279200) the check also compared the
f_sysrc_get output against ${1#*=}. APPEND and REMOVE build "new" from
the expanded "before", so only plain assignment mixes expanded and raw
text.
sysrc(8) says -c on an assignment succeeds "if no changes are
required". Running the same assignment without -c would rewrite the
line as it already is, so I think -c should compare against the raw
text in the file, not the expanded value. Is that intended?
If so, I'm happy to prepare a patch with a test in
tests/sysrc_test.sh. My idea is to leave the current comparison alone
and, only when it reports a difference, check whether the last
assignment in the file sysrc would edit is exactly NAME="<new>", and
treat that as unchanged.
Thanks,
Kushagra
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 299413] sysrc fails with $
Author: bugzilla-noreply
Date: Sat, 14 Nov 2026 22:42
Date: Sat, 14 Nov 2026 22:42
14 lines
2429 bytes
2429 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299413 --- Comment #2 from Devin Teske <dteske@FreeBSD.org> --- Good find. This is indeed a bug with `-c` that needs fixing. I have raised https://reviews.freebsd.org/D61584 -- You are receiving this mail because: You are the assignee for the bug. -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 299413] sysrc fails with $
Author: bugzilla-noreply
Date: Wed, 18 Nov 2026 16:42
Date: Wed, 18 Nov 2026 16:42
44 lines
3482 bytes
3482 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299413
--- Comment #3 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:
URL:
https://cgit.FreeBSD.org/src/commit/?id=09768aa53ba34ae2101f72cd583eb1f5da051a4e
commit 09768aa53ba34ae2101f72cd583eb1f5da051a4e
Author: Devin Teske <dteske@FreeBSD.org>
AuthorDate: 2026-11-18 16:35:37 +0000
Commit: Devin Teske <dteske@FreeBSD.org>
CommitDate: 2026-11-18 16:35:37 +0000
sysrc: Add -r raw and fixup -c assignment check
Add new -r flag to query raw, unexpanded values and display/use raw
values during assignments (including +=/-= assignments).
Constraint -c assignment checks to always use raw values when testing
if an assignment would induce a change or if the existing value is
already set as desired.
PR: 299413
MFC after: 2 weeks
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61584
usr.sbin/sysrc/sysrc | 40 ++-
usr.sbin/sysrc/sysrc.8 | 10 +-
usr.sbin/sysrc/sysrc.subr | 482 +++++++++++++++++++++++++++++++++++++
usr.sbin/sysrc/tests/sysrc_test.sh | 102 ++++++++
4 files changed, 621 insertions(+), 13 deletions(-)
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 299413] sysrc fails with $
Author: bugzilla-noreply
Date: Wed, 18 Nov 2026 21:14
Date: Wed, 18 Nov 2026 21:14
18 lines
2627 bytes
2627 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299413
Alexander Ziaee <ziaee@FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|bugs@FreeBSD.org |dteske@FreeBSD.org
Status|New |In Progress
CC| |ziaee@FreeBSD.org
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads