[Nagios-devel] regression in new release of nrpe (patch included)

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] regression in new release of nrpe (patch included)

Post by Guest »

--aVD9QWMuhilNxW9f
Content-Type: multipart/mixed; boundary="k1lZvvs/B4yU6o8G"
Content-Disposition: inline


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

hi ethan et al,

the latest version of nrpe introduces a regression in the config
file parsing code. a new block of code intended to trim trailing
whitespace is a little overzealous and truncates out all whitespace
instead of remaining whitespace.

that is, something like=20

command[check_users]=3D/usr/lib/nagios/plugins/check_users -w 5 -c 10

will be parsed as

command[check_users]=3D/usr/lib/nagios/plugins/check_users

instead of

command[check_users]=3D/usr/lib/nagios/plugins/check_users -w 5 -c 10

the attached patch fixes this.


sean


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="03_nrpe-trailing-whitespace.dpatch"
Content-Transfer-Encoding: quoted-printable

#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_nrpe-trailing-whitespace.dpatch by
##
## DP: fix for overzealous whitespace trimming in nrpe config reading code =
:)

@DPATCH@
diff -urNad nagios-nrpe-2.2~/src/nrpe.c nagios-nrpe-2.2/src/nrpe.c
--- nagios-nrpe-2.2~/src/nrpe.c 2006-01-21 20:23:36.000000000 +0100
+++ nagios-nrpe-2.2/src/nrpe.c 2006-01-24 17:50:43.000000000 +0100
@@ -307,10 +307,9 @@
=20
/* trim trailing whitespace */
len=3Dstrlen(input_line);
- for(x=3Dlen-1;x>=3D0;x--){
- if(isspace(input_line[x]))
+ for(x=3Dlen-1;x>=3D0 && isspace(input_line[x]);x--){
input_line[x]=3D'\x0';
- }
+ }
=20
/* skip comments and blank lines */
if(input_line[0]=3D=3D'#')

--k1lZvvs/B4yU6o8G--

--aVD9QWMuhilNxW9f
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD1lvoynjLPm522B0RArXcAJ4xAElv62JkGivthE4xZs2w1jMP9QCeOFFH
qIBTC9oojIcn+qoiw2YMPyA=
=jfqI
-----END PGP SIGNATURE-----

--aVD9QWMuhilNxW9f--





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