Bug 31798 - /etc/rc.d/init.d/network typo in handling gateway
Summary: /etc/rc.d/init.d/network typo in handling gateway
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-14 20:45 UTC by Need Real Name
Modified: 2014-03-17 02:19 UTC (History)
1 user (show)

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: ---


Attachments (Terms of Use)

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.


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