Bug 59457 - ifup-aliases assumes that ifconfig is in PATH
Summary: ifup-aliases assumes that ifconfig is in PATH
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-08 08:43 UTC by Pawel Salek
Modified: 2014-03-17 02:25 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2002-03-19 01:37:18 UTC


Attachments (Terms of Use)
Diff file that fixes this bug, and makes ifup-aliases more consistent with the rest of networking initscripts by hardcoding /sbin. (1.35 KB, patch)
2002-03-19 01:37 UTC, Justin S. Leitgeb
no flags Details | Diff

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!


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