Bug 42877 - Bad command line for pump in /etc/sysconfig/network-scripts/ifup
Summary: Bad command line for pump in /etc/sysconfig/network-scripts/ifup
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-05-30 16:15 UTC by Gabriel Schulhof
Modified: 2014-03-17 02:20 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-07-09 05:35:28 UTC
Embargoed:


Attachments (Terms of Use)

Description Gabriel Schulhof 2001-05-30 16:15:34 UTC
Description of Problem:

/etc/sysconfig/network-scripts/ifup (Line # ~= 126) tries to perform the following when bringing up a dynamically configured interface:



...

if [ -x /sbin/pump ] && /sbin/pump ${PUMPARGS} -i ${DEVICE} ; then

...



However, pump doesn't like having its argv[1] equal to a blank string.  This is exactly what happens if ${PUMPARGS} evaluates to an empty string, i.e., the script tries to execute

/sbin/pump '' -i eth0

(assuming ${DEVICE} evaluates to eth0) to which pump replies

pump: no extra parameters are expected

and exits with a value of 1.  The correct solution would be to construct a string out of the various parameters and pass it to the shell for execution as a single string (in one piece), so that the shell may amalgamate and eliminate any extra spaces, i.e:



...

PUMP_COMMAND=`echo "/sbin/pump ${PUMPARGS} -i ${DEVICE}"`
if [ -x /sbin/pump ] && ${PUMP_COMMAND} ; then

...



Or simply:



...

PUMP_COMMAND="/sbin/pump ${PUMPARGS} -i ${DEVICE}"

if [ -x /sbin/pump ] && ${PUMP_COMMAND} ; then

...



How Reproducible:

Easily



Steps to Reproduce:

1. Run the following (under /bin/bash):

2. /sbin/pump '' -i eth0

3. Above, replace eth0 with whatever interface is available on your system, including lo, because pump doesn't even get as far as actually trying to retrieve an IP, because it dies in the parsing-the-cmdline stage.



Actual Results:

Pump exits with 1 because it doesn't like

!strcmp (argv[1], "") ;



Expected Results:

Successful retrieval of a DHCP-IP via pump



Additional Information:

	

pump is more useful than dhcpcd because one has some degree of control over the /etc/resolv.conf it generates.  In my particular case, I make use of the "domainsearch" parameter of /etc/pump.conf to override the 

"search" statement it puts into /etc/resolv.conf.  Plus, it doesn't make sense for an init script to even try pump, if it doesn't build pump's command line to pump's liking.

Comment 1 Bill Nottingham 2001-07-09 05:35:24 UTC
I don't see this here; how are you setting the arguments?

PUMPARGS= pump ${PUMPARGS} -i eth0

works fine for me.


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