Bug 156972 - ifup-routes ignores the last static route line in route-* if file doesn't end with newline
ifup-routes ignores the last static route line in route-* if file doesn't end...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-05 15:43 EDT by Gabriel Mihaes
Modified: 2014-03-16 22:53 EDT (History)
1 user (show)

See Also:
Fixed In Version: 8.17-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-03 17:06:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gabriel Mihaes 2005-05-05 15:43:12 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040904 Firefox/0.9.3

Description of problem:
When adding static routes using route-* files, the last line is ignored by ifup-routes if that line doesn't end with a newline character:

From /etc/sysconfig/network-scripts/ifup-routes :
           while read line; do
               /sbin/ip route add $line
           done < "$file"
                                                                                                                              
There's a wrong way for treating the contents of route-* files. A simple example to reproduce the undesired effect:
[root@c0kered tmp]# cat test.txt
10.0.0.0/24 via 1.1.1.1
20.20.20.0/24 via 2.2.2.2
30.30.30.0/24 via 3.3.3.3[root@c0kered tmp]#
[root@c0kered tmp]# while read line; do echo $line; done < test.txt
10.0.0.0/24 via 1.1.1.1
20.20.20.0/24 via 2.2.2.2
[root@c0kered tmp]#


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Edit /etc/sysconfig/network-scripts/route-eth0
2.EOF should be right at the end of the last line containing a route without being terminated by \n
3.service network restart


Additional info:
Comment 1 Bill Nottingham 2005-10-03 17:06:42 EDT
Fixed in CVS, will be in 8.17-1.

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