This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 154353 - ifup-routes fails to ignore commented lines.
ifup-routes fails to ignore commented lines.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
: 81821 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-10 17:14 EDT by Terje Bless
Modified: 2014-03-16 22:53 EDT (History)
2 users (show)

See Also:
Fixed In Version: 8.08-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-12 23:43:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
route-eth0 that tickles both of the poor comment handling bits of ifup-routes. (104 bytes, text/plain)
2005-04-10 17:14 EDT, Terje Bless
no flags Details
Ignore comments in route-eth0 files. (668 bytes, patch)
2005-04-10 17:17 EDT, Terje Bless
no flags Details | Diff
a better patch (1.10 KB, patch)
2005-04-11 16:42 EDT, Bill Nottingham
no flags Details | Diff
Modified patch to ignore comments and blank lines. (666 bytes, patch)
2005-04-12 11:01 EDT, Terje Bless
no flags Details | Diff
Modified patch to ignore comments and blank lines. (661 bytes, patch)
2005-04-12 11:08 EDT, Terje Bless
no flags Details | Diff

  None (edit)
Description Terje Bless 2005-04-10 17:14:05 EDT
The ifup-routes script from initscripts-8.07-1 fails to ignore comment lines in
"route-<interface>" files, and chokes if a mix of old and new syntax is in use.

If any "ADDRESSn" lines are found in the file, despite being commented out,
ifup-routes will assume "newer" syntax is in use and feed it to handle_file.

The handle_file function sources the file, which in effect ignores comments,
and will then fail if any uncommented "older" syntax lines are present (they
will get treated as commands instead of arguments to "/sbin/ip route add").


Once the test for syntax version is fixed to ignore comments, the parsing of
the "older" syntax needs to be modified in a similar fashion; otherwise it
will attempt to pass stuff like "#ADDRESS0=1.2.3.4" as arguments to
"/sbin/ip route add" (which will obviously fail, noisily).


This is a superset of the problem described in Bug #114548.
Comment 1 Terje Bless 2005-04-10 17:14:05 EDT
Created attachment 112932 [details]
route-eth0 that tickles both of the poor comment handling bits of ifup-routes.
Comment 2 Terje Bless 2005-04-10 17:17:25 EDT
Created attachment 112933 [details]
Ignore comments in route-eth0 files.

The attached patch makes syntax version detection ignore commented lines, and
ditto for the parsing of "older" syntax files.

These are strictly separate issues, but since the patch is all of 20 lines
including context... :-)
Comment 3 Bill Nottingham 2005-04-11 16:42:55 EDT
Created attachment 112992 [details]
a better patch

I'm committing this; it looks simpler and calls less commands.
Comment 4 Bill Nottingham 2005-04-11 16:43:31 EDT
Erm, *fewer* commands. *whack*
Comment 5 Bill Nottingham 2005-04-11 16:45:27 EDT
Will be in 8.08-1.
Comment 6 Terje Bless 2005-04-12 11:01:14 EDT
Created attachment 113021 [details]
Modified patch to ignore comments and blank lines.

Patch #112992 will emit RTNETLINK errors for blank lines, and the ${line##\#}
syntax just makes my head hurt.

This modified patch makes the test also ignore blank lines and uses better
grokkable (regex match) test logic.

Note that the patch is against 8.07-1 since 8.08-1 hasn't hit my mirrors yet.
Comment 7 Terje Bless 2005-04-12 11:08:24 EDT
Created attachment 113024 [details]
Modified patch to ignore comments and blank lines.

*sigh*

And of course I had to leave a leftover "echo" in there. :-(
Comment 8 Bill Nottingham 2005-04-12 23:43:10 EDT
Thanks, added. Will still be in 8.08-1. :)
Comment 9 Bill Nottingham 2005-09-30 14:26:40 EDT
*** Bug 81821 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.