Bug 156972

Summary: ifup-routes ignores the last static route line in route-* if file doesn't end with newline
Product: [Fedora] Fedora Reporter: Gabriel Mihaes <gabim>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 8.17-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-03 21:06:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gabriel Mihaes 2005-05-05 19:43:12 UTC
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 21:06:42 UTC
Fixed in CVS, will be in 8.17-1.