Bug 102337 - ifup-ppp mishandles full pathname of CONFIG file
ifup-ppp mishandles full pathname of CONFIG file
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-08-13 19:03 EDT by John Reiser
Modified: 2014-03-16 22:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-30 15:21:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description John Reiser 2003-08-13 19:03:00 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
Trying to invoke ifup-ppp with the full pathname of the CONFIG file usually
fails because of a logic error in /etc/sysconfig/network-scripts/ifup-ppp.
-----line 13
  # just in case a full path to the configuration file is passed in
  CONFIG=$(basename $1)
  [ -f "${CONFIG}" ] || CONFIG=ifcfg-${1}
  source_config
-----
The full pathname is removed by 'basename' on line 14, which forces the
'source_config' on line 16 to fail unless the working directory matches.  (Also
"ifcfg-${1}" makes no sense if $1 is a full pathname.)
This makes it nearly impossible to specify the full pathname of a CONFIG file.

Instead, the logic should be something like
-----
  # just in case a full path to the configuration file is passed in
  CONFIG="$1"
  [ -f "${CONFIG}" ] || CONFIG=ifcfg-$(basename "${CONFIG}")
  source_config
-----
which tests the full pathname first before applying basename if needed.


Version-Release number of selected component (if applicable):
initscripts-7.14-1

How reproducible:
Always

Steps to Reproduce:
1. sh -x /etc/sysconfig/network-scripts/ifup-ppp  _full_path_to_CONFIG_file
2.
3.
    

Actual Results:  + '[' /etc/sysconfig/networking/profiles/default/ifcfg-Olympus
= daemon ']'
++ basename /etc/sysconfig/networking/profiles/default/ifcfg-Olympus
+ CONFIG=ifcfg-Olympus
+ '[' -f ifcfg-Olympus ']'
+ CONFIG=ifcfg-/etc/sysconfig/networking/profiles/default/ifcfg-Olympus
+ source_config
++ basename ifcfg-/etc/sysconfig/networking/profiles/default/ifcfg-Olympus
++ sed 's/^ifcfg-//g'
+ DEVNAME=Olympus
+ basename ifcfg-/etc/sysconfig/networking/profiles/default/ifcfg-Olympus
+ grep -q '[^g]-'
+ . ifcfg-/etc/sysconfig/networking/profiles/default/ifcfg-Olympus
/etc/sysconfig/network-scripts/ifup-ppp: line 35:
ifcfg-/etc/sysconfig/networking/profiles/default/ifcfg-Olympus: No such file or
directory


Expected Results:  Use the full pathname for CONFIG.

Additional info:
Comment 1 Bill Nottingham 2003-09-15 01:35:00 EDT
AFAIK, it's never actually defined or stated anywhere that using files outside
of /etc/sysconfig/network-scripts directly should work.
Comment 2 Bill Nottingham 2005-09-30 15:21:34 EDT
Closing bugs on older, no longer supported, releases. Apologies for any lack of
response.

ifup, in its usage, does specify to pass a device name, not a file name. As
such, closing.

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