[Nagios-devel] [PATCH 3/3] Patch to mini_epn to allow any command

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 3/3] Patch to mini_epn to allow any command

Post by Guest »

---
Changelog | 1 +
contrib/mini_epn.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)

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

diff --git a/contrib/mini_epn.c b/contrib/mini_epn.c
index 598e239..1e4f72e 100644
--- a/contrib/mini_epn.c
+++ b/contrib/mini_epn.c
@@ -7,6 +7,8 @@
#include
#include "epn_nagios.h"

+#define MAX_INPUT_CHARS 1024
+
static PerlInterpreter *my_perl = NULL;

int main(int argc, char **argv, char **env) {
@@ -19,9 +21,9 @@ int main(int argc, char **argv, char **env) {

char *embedding[] = { "", "p1.pl" };
char *plugin_output ;
- char fname[64];
+ char fname[MAX_INPUT_CHARS];
char *args[] = {"","0", "", "", NULL };
- char command_line[80];
+ char command_line[MAX_INPUT_CHARS];
int exitstatus;
int pclose_result;

@@ -35,7 +37,7 @@ int main(int argc, char **argv, char **env) {

exitstatus=perl_run(my_perl);

- while(printf("Enter file name: ") && fgets(command_line, 80, stdin)) {
+ while(printf("Enter file name: ") && fgets(command_line, MAX_INPUT_CHARS-1, stdin)) {
SV *plugin_hndlr_cr;
STRLEN n_a;
int count = 0 ;
--
1.7.1






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