Bug 208938 - usr.sbin/config does not preserve whitespace in static env
Summary: usr.sbin/config does not preserve whitespace in static env
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Kyle Evans
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-04-20 15:29 UTC by Sylvain Garrigues
Modified: 2018-11-19 07:32 UTC (History)
4 users (show)

See Also:
koobs: mfc-stable11+


Attachments
Preserve spaces and tabs between quotes in /usr/sbin/config (975 bytes, patch)
2016-04-20 15:29 UTC, Sylvain Garrigues
no flags Details | Diff
Preserve spaces and tabs between quotes in /usr/sbin/config (763 bytes, patch)
2016-04-20 18:13 UTC, Sylvain Garrigues
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain Garrigues 2016-04-20 15:29:27 UTC
Created attachment 169494 [details]
Preserve spaces and tabs between quotes in /usr/sbin/config

I should be able to set values with spaces in my kernel static environment (option 'env  mykernel-static-env.env' in my kernel config, as long as they are between quotes.

For instance, I want to be able to set:
loader_conf_files="/boot/loader.conf /boot/loader.conf.local"

Right now, this gets transformed into:
loader_conf_files="/boot/loader.conf/boot/loader.conf.local"

Attached patch fixes the issue and preserves spaces and tabs.
Comment 1 Sylvain Garrigues 2016-04-20 18:13:12 UTC
Created attachment 169500 [details]
Preserve spaces and tabs between quotes in /usr/sbin/config

Correct patch attached
Comment 2 Kyle Evans freebsd_committer freebsd_triage 2018-08-03 02:39:33 UTC
Hi,

Sorry for the radio silence on this. I committed a new version of the env line sanitizer (written by ian@) in r335642 which also fixed this, and later revisions to config(8) fixed this same kind of bug in hints.

I'll be MFC'ing the rewrite and all of my other env work (deduplication, fixing the order of precedence) likely this weekend.

Thanks,

Kyle Evans
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2018-11-19 02:13:38 UTC
Hi Kyle, what were the revision(s) for the merge(s), and did this go/need to go to stable/12?
Comment 4 Kyle Evans freebsd_committer freebsd_triage 2018-11-19 02:20:55 UTC
(In reply to Kubilay Kocak from comment #3)

Hi,

Sorry, I should have been informative. =) The commit for this that rewrote the offending parser predated stable/12, r335642; it was merged to stable/11 in r335863, so all supported branches have the fix.

Thanks,

Kyle Evans
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2018-11-19 07:23:59 UTC
Thanks! For bonus linking points:

base r335642 (current: 12.0)
base r335863 (mfc: stable/11)