Bug 31798 - /etc/rc.d/init.d/network typo in handling gateway
/etc/rc.d/init.d/network typo in handling gateway
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-14 15:45 EST by Need Real Name
Modified: 2014-03-16 22:19 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-03-14 15:45:38 EST
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 Need Real Name 2001-03-14 15:45:35 EST
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 17:13:41 EST
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.

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