[Nagiosplug-devel] [ nagiosplug-Patches-2268675 ] fix for quoting in check_by_ssh

SourceForge.net noreply at sourceforge.net
Tue May 26 10:31:53 CEST 2009


Patches item #2268675, was opened at 2008-11-12 05:32
Message generated for change (Comment added) made by dermoth
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=2268675&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: Bugfix
Group: release-1.4.14
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Will Preston (wpreston)
Assigned to: Thomas Guyot-Sionnest (dermoth)
Summary: fix for quoting in check_by_ssh

Initial Comment:

check_by_ssh builds its check into a single string and passes it to the np_runcmd() function to execute ssh.  This function parses the command line back into ssh options and calls execve.  Unfortunately the conversion causes various problems with quoted strings.
The patch bypasses this conversion and passes the option string directly to execve. This should ensure that ssh checks and local checks are identical.


Example:


> /bin/sh -c "echo '"'$PATH'"'"
$PATH
> /bin/sh -c 'echo "a b"'
a b
>

Unpatched:
> check_by_ssh -H localhost -C "echo '"'$PATH'"'"
/usr/local/bin:/usr/bin/:/bin
> check_by_ssh -H localhost -C 'echo "a b"'
Could not open pipe: /usr/bin/ssh localhost 'echo "a b"'
>

Patched:
> check_by_ssh -H localhost -C "echo '"'$PATH'"'"
$PATH
> check_by_ssh -H localhost -C 'echo "a b"'
a b
>


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

Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2009-05-26 04:31

Message:
This problem is now fixed in Git. Thank you for your report.

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

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




More information about the Devel mailing list