NetworkManager/system-settings/plugins
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
..
ifcfg-rh ifcfg-rh: add testcase for DHCPv6 only mode 2010-08-10 16:35:19 -05:00
ifcfg-suse ifcfg-suse: Clean up, upstream the patch which has been in use for a while 2009-12-21 12:07:18 +02:00
ifupdown ifupdown: make parser for /etc/network/interfaces more robust 2010-08-12 22:41:05 -05:00
keyfile keyfile: correctly send the 'update' signal 2010-07-28 02:28:45 -07:00
Makefile.am 2008-11-25 Dan Williams <dcbw@redhat.com> 2008-11-25 22:42:21 +00:00