Bug 59457 - ifup-aliases assumes that ifconfig is in PATH
ifup-aliases assumes that ifconfig is in PATH
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
All Linux
medium Severity low
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-08 03:43 EST by Pawel Salek
Modified: 2014-03-16 22:25 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-18 20:37:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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-18 20:37 EST, Justin S. Leitgeb
no flags Details | Diff

  None (edit)
Description Pawel Salek 2002-02-08 03:43:56 EST
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-18 20:37:14 EST
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 02:12:10 EDT
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.