[Nagiosplug-devel] [ nagiosplug-Bugs-1250967 ] broken awk script subst.in

SourceForge.net noreply at sourceforge.net
Sat Mar 15 21:11:36 CET 2008


Bugs item #1250967, was opened at 2005-08-03 13:53
Message generated for change (Comment added) made by nsturm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1250967&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parsing problem
Group: None
>Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: nsturm (nsturm)
Assigned to: Nobody/Anonymous (nobody)
Summary: broken awk script subst.in

Initial Comment:
The script plugins-scripts/subst.in does things in the wrong order
resulting in broken pathnames. As an example look at check_rpc.pl.

First "use lib utils.pm;" is substituted by the full path name to utils.pm,
but then the first name component is stripped off again (at least on
OpenBSD where /usr/local/libexec/nagios/utils.pm becomes just
nagios/utils.pm)

This is on OpenBSD-current with plugins 1.4 and 1.4.1. Diff attached.

----------------------------------------------------------------------

>Comment By: nsturm (nsturm)
Date: 2008-03-15 21:11

Message:
Logged In: YES 
user_id=1323236
Originator: YES

I was able to reproduce the problem, the cause is the last substitution in
plugins-scripts/subst.in (lines 65-68).
If you build nagios-plugins on OpenBSD, the substitution in line 48 will
replace "use lib utils.pm" with
'use lib "/usr/local/libexec/nagios"'. If this directory does not exist
however, lines 65-68 will strip
/usr/local/libexec/ from this line (the directory does not exist when
building the port on a clean system).
I suggest not using which() in that script or at least returning an
unchanged c in case the alleged binary
is not found anywhere.

----------------------------------------------------------------------

Comment By: SourceForge Robot (sf-robot)
Date: 2007-06-26 04:20

Message:
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

----------------------------------------------------------------------

Comment By: Matthias Eble (psychotrahe)
Date: 2007-06-11 10:13

Message:
Logged In: YES 
user_id=1694341
Originator: NO

Announced pending state by sending emails to the participants.

----------------------------------------------------------------------

Comment By: Matthias Eble (psychotrahe)
Date: 2007-06-05 14:07

Message:
Logged In: YES 
user_id=1694341
Originator: NO

Hi all,

I have tried to reproduce this case on freebsd 6.2. But the lines were
substituted correctly. 
use lib PREFIX/libexec
use utils (...

I tried 1.4.1, 1.4.3 and 1.4.5. Could you please test if this issue
perstists with the latest version (1.4.9 or cvs snapshot)?

Matthias

----------------------------------------------------------------------

Comment By: Olexandr Davydenko (blackraven1977)
Date: 2006-12-08 20:48

Message:
Logged In: YES 
user_id=1526665
Originator: NO

Similar problem on FreeBSD 6.2-RC1 and nagios-plugins-1.4.5 .
For example: in nagios-plugins-1.4.3 string in check_mailq.pl "use lib
utils.pm;" substituted with full path in installed check_mailq "use lib 
"/usr/local/libexec/nagios";", but in nagios-plugins-1.4.5 it substituted
as "use lib  "nagios";" and check_mailq plugin cannot find utils.pm .
Patch patch-plugins-scripts_subst_in fix this.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1250967&group_id=29880




More information about the Devel mailing list