[Nagios-devel] [PATCH 1/3] Revert "Patch to mini_epn to allow any

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH 1/3] Revert "Patch to mini_epn to allow any

Post by Guest »

This reverts commit 2032dd3f2fddc50f9debd66f7f20aa6cb1fdcbf6.
---
Changelog | 1 -
THANKS | 1 -
contrib/new_mini_epn.c | 45 +++++++++++++++++----------------------------
3 files changed, 17 insertions(+), 30 deletions(-)

diff --git a/Changelog b/Changelog
index 84427f9..b4283da 100644
--- a/Changelog
+++ b/Changelog
@@ -6,7 +6,6 @@ Nagios 3.x Change Log
3.2.2 - ??/??/2010
------------------
ENHANCEMENTS
-* Patch to mini_epn to allow any command line length without breaking on extra trailing or leading whitespace (Ray Bengen)
* Patch to speed up loading of state retention data (Matthieu Kermagoret)
* Custom notifications are now suppressed during scheduled downtime (Sven Nierlein)

diff --git a/THANKS b/THANKS
index b10e20a..bacf809 100644
--- a/THANKS
+++ b/THANKS
@@ -28,7 +28,6 @@ since 1999. If I missed your name, let me know.
* Simon Beale
* Ben Bell
* Marlo Bell
-* Ray Bengen
* Derrick Bennett
* Chris Bensend
* Kevin Benton
diff --git a/contrib/new_mini_epn.c b/contrib/new_mini_epn.c
index 2d84b5d..4320111 100644
--- a/contrib/new_mini_epn.c
+++ b/contrib/new_mini_epn.c
@@ -217,38 +217,27 @@ void deinit_embedded_perl(void){

int main(int argc, char **argv, char **env) {

- init_embedded_perl();
- /* Calls Perl to load and construct a new
- * Term::ReadLine object.
- */
+ char command_line[128];

- init_term_readline();
-
- while (1) {
- /*
- * get_command_line calls Perl to get a scalar from stdin
- */
-
- /* Perl Term::ReadLine::readline() method chomps the "\n"
- * from the end of the input.
- */
- char *cmd,*end;
- /* Allow any length command line */
- cmd = (get_command_line ()) ;
+ init_embedded_perl();
+ /* Calls Perl to load and construct a new
+ * Term::ReadLine object.
+ */

- // Trim leading whitespace
- while (isspace (*cmd)) cmd++;
+ init_term_readline();

- // Trim trailing whitespace
- end = cmd + strlen (cmd) - 1;
- while (end > cmd && isspace (*end)) end--;
+ while (1) {
+ /*
+ * get_command_line calls Perl to get a scalar from stdin
+ */

- // Write new null terminator
- *(end+1) = 0;
+ strncpy(command_line, get_command_line(), 128) ;

- run_plugin (cmd) ;
- }
+ /* Perl Term::ReadLine::readline() method chomps the "\n"
+ * from the end of the input.
+ */
+ run_plugin(command_line) ;
+ }

- deinit_embedded_perl();
+ deinit_embedded_perl();
}
-
--
1.7.1






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked