Bug 130536 - ntptrace searchs ntpq in $PATH
ntptrace searchs ntpq in $PATH
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: ntp (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-21 07:14 EDT by Ralf Corsepius
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-31 08:29:43 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 Ralf Corsepius 2004-08-21 07:14:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2)
Gecko/20040803

Description of problem:
Excuting ntptrace without having /usr/sbin in $PATH produces this:
# /usr/sbin/ntptrace localhost
Can't exec "ntpq": No such file or directory at /usr/sbin/ntptrace
line 22.
failed to start command ntpq -n -c rv localhost: No such file or
directory at /usr/sbin/ntptrace line 22.


Version-Release number of selected component (if applicable):
ntp-4.2.0-7

How reproducible:
Always

Steps to Reproduce:
1. Login as normal user or "su root"
(Without having /usr/bin in $PATH)

2. Invoke
/usr/sbin/ntptrace


Actual Results:  Non function.

Expected Results:  function.

Additional info:

Origin of this bug is /usr/sbin/ntptrace looking for "ntpq" in $PATH:

From /usr/sbin/ntptrace:
...
$ntpq = "ntpq";
                                                                     
          ...
        $cmd = "$ntpq -n -c rv $host";
        open(PH, $cmd . "|") || die "failed to start command $cmd: $!
...

A fix would be to hard-code the absolute path to ntpq:
$ntpq = "/usr/sbin/ntpq"

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