Bug 31798

Summary: /etc/rc.d/init.d/network typo in handling gateway
Product: [Retired] Red Hat Linux Reporter: Need Real Name <jean-paul_abgrall>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-03-14 20:45:38 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 Need Real Name 2001-03-14 20:45:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.73 [en] (Win98; I)

diff -c network*
*** network     Wed Mar 14 11:42:03 2001
--- network~    Tue Mar  7 08:30:13 2000
***************
*** 69,75 ****
        # Add non interface-specific static-routes.
        if [ -f /etc/sysconfig/static-routes ]; then
           grep "^any" /etc/sysconfig/static-routes | while read ignore type dest netmask mask gw gateway; do
!             [ "${gateway}" != "${gateway##[0-9]}" ] && \
                /sbin/route add -$type $dest $netmask $mask $gw $gateway
           done
        fi    
--- 69,75 ----
        # Add non interface-specific static-routes.
        if [ -f /etc/sysconfig/static-routes ]; then
           grep "^any" /etc/sysconfig/static-routes | while read ignore type dest netmask mask gw gateway; do
!             [ "${gateway}" != "${gateway##[0-9}" ] && \
                /sbin/route add -$type $dest $netmask $mask $gw $gateway
           done
        fi    


Reproducible: Always
Steps to Reproduce:
1. Install RHL7.0
2. login as root
3. vi +72 /etc/rc.d/init.d/network
	

Actual Results:                [ "${gateway}" != "${gateway##[0-9}" ] && \


Expected Results:                [ "${gateway}" != "${gateway##[0-9]}" ] && \


It seems like the expression ${g##[0-9]} is there to test whether the 1st characters are actually numbers. The expression is using shell 
expansion and '[0-9' is not very meaningfull is this case.

Comment 1 Bill Nottingham 2001-03-14 22:13:41 UTC
This was fixed a while ago. I don't recall the exact version where it was
fixed, but it's fixed in the current rawhide packages.