Page MenuHomeFreeBSD

parse() in boot loader interp_parse.c is too naive about quotes
ClosedPublic

Authored by tsoome on Apr 19 2016, 2:53 PM.
Tags
None
Referenced Files
F83686855: D6000.id15619.diff
Mon, May 13, 3:44 PM
Unknown Object (File)
Sun, May 12, 10:20 AM
Unknown Object (File)
Sat, May 11, 11:29 PM
Unknown Object (File)
Sat, May 11, 12:34 PM
Unknown Object (File)
Fri, May 10, 12:27 PM
Unknown Object (File)
Fri, May 10, 12:26 PM
Unknown Object (File)
Fri, May 10, 12:26 PM
Unknown Object (File)
Fri, May 10, 6:50 AM

Details

Summary

current logic how the quotes (both ' and ") are managed is a bit too relaxed,
allowing wierd constructs like set name="value' also usual single quote
semantics is not possible and, the code does not check if the quoted string
actually has ending quote.

This update implements:

  1. distinguishing single and double quote
  2. variable expansion will not be done inside single quote protected area
  3. will preserve inner quote for values like "value 'some list'"
  4. ending quote check.

however, this diff does not implement ending quote order check - it shouldn't be too hard, needs some improvements on parser state machine.

this is fix for bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204602

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tsoome retitled this revision from to parse() in boot loader interp_parse.c is too naive about quotes.
tsoome updated this object.
tsoome edited the test plan for this revision. (Show Details)

Updated to revision 298625.

Updated to revision 298901.

Updated to revision 300296.

Updated to revision 300296.

Updated to revision 301442.

This revision is now accepted and ready to land.Jul 30 2016, 5:53 PM
This revision was automatically updated to reflect the committed changes.