Bug 130536 - ntptrace searchs ntpq in $PATH
Summary: ntptrace searchs ntpq in $PATH
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: ntp
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-21 11:14 UTC by Ralf Corsepius
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-08-31 12:29:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ralf Corsepius 2004-08-21 11:14:01 UTC
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.