NetworkManager/system-settings/plugins/ifupdown
Peter Marschall a5b77939fb ifupdown: make parser for /etc/network/interfaces more robust
The previous implementation of the parser for /etc/network/interfaces had
quite a few drawbacks:
- it expected the lines to be terminated with "\n", even the last line
- it ignored line wraps with "\\" followed by "\n"
- it expected over-long lines to be shorter than 510 characters
- it ignored line wraps on over-long lines
- it treated spaces and tabs differently
- it did not make sure to really tokenize on word boundaries
- it treated the equivalent stanzas "auto" and "allow-auto" differently
- it ignored the fact that the "allow-*" stanzas can take multiple arguments
  that need to be separated to be recognized NetworkManager's processing later
- it allowed "non-block" stanzas to appear before a block

This patch is a rewrite of the parser to fix the issues mentioned:
- it accepts the last line even if it is not terminated by "\n"
- it skips over-long lines, emits a warning and even takes into account
  that over-long lines may be wrapped to next lines
- it un-wraps wrapped lines
- it uses spaces and tabs equivalently to tokenize the input
- it treats "allow-auto" as a synonym to "auto"
- it splits multi-argument "auto"/"allow-*" into multiple
  single-argument stanzas of the same type
- it warns on data stanzas before the first block stanza
2010-08-12 22:41:05 -05:00
..
tests ifupdown: add ifparser testcases 2010-08-12 22:35:13 -05:00
interface_parser.c ifupdown: make parser for /etc/network/interfaces more robust 2010-08-12 22:41:05 -05:00
interface_parser.h ifupdown: add ifparser testcases 2010-08-12 22:35:13 -05:00
Makefile.am ifupdown: add ifparser testcases 2010-08-12 22:35:13 -05:00
nm-ifupdown-connection.c ifupdown: port to new settings API 2009-08-12 17:13:24 -05:00
nm-ifupdown-connection.h ifupdown: fix connection class inheritance 2010-08-04 01:54:10 -05:00
parser.c ifupdown: port to new settings API 2009-08-12 17:13:24 -05:00
parser.h ifupdown: port to new settings API 2009-08-12 17:13:24 -05:00
plugin.c ifupdown: split parsers into convenience library for easier testcase creation 2010-08-12 18:15:21 -05:00
plugin.h License header and FSF address update 2008-12-20 09:46:41 -05:00