Bug 42877 - Bad command line for pump in /etc/sysconfig/network-scripts/ifup
Bad command line for pump in /etc/sysconfig/network-scripts/ifup
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-30 12:15 EDT by Gabriel Schulhof
Modified: 2014-03-16 22:20 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-09 01:35:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gabriel Schulhof 2001-05-30 12:15:34 EDT
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 01:35:24 EDT
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.