Bug 59457

Summary: ifup-aliases assumes that ifconfig is in PATH
Product: [Retired] Red Hat Linux Reporter: Pawel Salek <pawsa>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: low Docs Contact:
Priority: medium    
Version: 7.2CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-19 01:37:18 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:
Attachments:
Description Flags
Diff file that fixes this bug, and makes ifup-aliases more consistent with the rest of networking initscripts by hardcoding /sbin. none

Description Pawel Salek 2002-02-08 08:43:56 UTC
Description of problem:
/etc/sysconfig/network-scripts/ifup-aliases assumes that ifconfig is in PATH,
i.e. that running ifconfig will run /sbin/ifconfig - but it does not check the
PATH env variable to ensure it. This affect functionality when for some reason
/sbin is not in PATH.

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

How reproducible:
Always

Steps to Reproduce:
1. (assuming eth0 is controlled by DHCP)
2. su
3. /sbin/dhcpd


Actual Results:  /etc/sysconfig/network-scripts/ifup-aliases: ifconfig: command
not found

Expected Results:  No error message is printed.

Additional info:

The patch is
--- /etc/sysconfig/network-scripts/ifup-aliases.orig	Fri Feb  8 09:37:40 2002
+++ /etc/sysconfig/network-scripts/ifup-aliases	Fri Feb  8 09:38:11 2002
@@ -77,7 +77,7 @@
        #
 
 # sorry this is all one line -- it didn't work on multiple lines for me
-eval `LC_ALL= LANG= ifconfig | sed -e ' /^[^[:space:]]*:[0-9]*/ {
s|^\([^:]*\):\([0-9]*\).*$|X=x; TMP="\2"; [ "$device" != "\1" ] \|\| |g; b; };
/^[^[:space:]]/ { s|.*|X=x; [ 0 = 0 ] \|\| |g; b; }; /inet
addr:[0-9]*\.[0-9]*\.[0-9]*\.[0-9]* *Bcast:[0-9.]* *Mask:[0-9.]*/ { s|^.*inet
addr:\(\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\) *Bcast:\([0-9.]*\)
*Mask:\([0-9.]*\).*$|eval " rdev_${TMP}_addr=\1; rdev_${TMP}_mb=\7_\6;
rdevip_\2_\3_\4_\5=${TMP}; rdev_LIST=\\\\"\\\\$rdev_LIST \\\\${TMP}\\\\"; " \|\|
|g; b; }; s|^.*$||g; ' ` X=x;
+eval `LC_ALL= LANG= /sbin/ifconfig | sed -e ' /^[^[:space:]]*:[0-9]*/ {
s|^\([^:]*\):\([0-9]*\).*$|X=x; TMP="\2"; [ "$device" != "\1" ] \|\| |g; b; };
/^[^[:space:]]/ { s|.*|X=x; [ 0 = 0 ] \|\| |g; b; }; /inet
addr:[0-9]*\.[0-9]*\.[0-9]*\.[0-9]* *Bcast:[0-9.]* *Mask:[0-9.]*/ { s|^.*inet
addr:\(\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\) *Bcast:\([0-9.]*\)
*Mask:\([0-9.]*\).*$|eval " rdev_${TMP}_addr=\1; rdev_${TMP}_mb=\7_\6;
rdevip_\2_\3_\4_\5=${TMP}; rdev_LIST=\\\\"\\\\$rdev_LIST \\\\${TMP}\\\\"; " \|\|
|g; b; }; s|^.*$||g; ' ` X=x;
 
 if [ -z "$rdev_LIST" ]; then
        no_devices_are_up=yes
@@ -251,7 +251,7 @@
 
 ##echo "setting up device $DEVICE"
 
-               ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast
${BROADCAST}
+               /sbin/ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast
${BROADCAST}
 
                if [ "$NO_ALIASROUTING" != yes ]; then
 
--------------------------
or just run perl -pi -e 's,(\s)ifconfig,$1/sbin/ifconfig,g'
/etc/sysconfig/network-scripts/ifup-aliases
to fix it.

Comment 1 Justin S. Leitgeb 2002-03-19 01:37:14 UTC
Created attachment 48944 [details]
Diff file that fixes this bug, and makes ifup-aliases more consistent with the rest of networking initscripts by hardcoding /sbin.

Comment 2 Bill Nottingham 2002-04-10 06:12:10 UTC
Will be fixed in 6.62-1; thanks!