Bug 42877

Summary: Bad command line for pump in /etc/sysconfig/network-scripts/ifup
Product: [Retired] Red Hat Linux Reporter: Gabriel Schulhof <gabrielschulhof>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-07-09 05:35:28 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:

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.