Re: [Nagios-devel] [BUG] Missing new line in cmd.cgi [3.0.5] -

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

Re: [Nagios-devel] [BUG] Missing new line in cmd.cgi [3.0.5] -

Post by Guest »

Hendrik B=E4cker wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> =20
> Hendrik B=E4cker schrieb:
>> @Andreas: Do you see any security risk when putting an "\n" to the
>> end of cmd in "cmd_submitf()"? Seems to me as the easiest way.
>>
> Hey,
>=20
> this might help even in a secure manner:
>=20
> - --- cmd.c 2008-11-06 15:11:33.000000000 +0100
> +++ cmd.c.patched 2008-11-06 15:05:44.000000000 +0100
> @@ -2250,6 +2250,7 @@
>=20
> /* write the command to file */
> fputs(cmd,fp);
> + fputs("\n",fp);
>=20

It should be be done as a single write. I'll come up with something.

I was stupid enough to think that fputs() works like puts() in that
it also writes out the newline. Reading 'man fputs', I guess I was
wrong.

--=20
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231





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