quick and dirty hack to get nrpe to compile on Tru64 / Dec OSF1

Joost van Baal j.e.vanbaal at uvt.nl
Fri Jul 9 16:29:02 CEST 2004


Hi,

I've successfully compiled and ran nrpe 1.9 on a OSF1 V4.0 878 alpha machine.
However, I've had to do some evil tricks: since OSF1 seems to lack snprintf
in it's stdio.h, I've changed these to sprintf calls:


460c460
< 				snprintf(connecting_host,sizeof(connecting_host),"%s",inet_ntoa(nptr->sin_addr));
---
> 				sprintf(connecting_host,"%s",inet_ntoa(nptr->sin_addr));
568c568
< 		snprintf(buffer,sizeof(buffer),"NRPE v%s",PROGRAM_VERSION);
---
> 		sprintf(buffer,"NRPE v%s",PROGRAM_VERSION);
583c583
< 			snprintf(buffer,sizeof(buffer),"NRPE: Command '%s' not defined",receive_packet.buffer);
---
> 			sprintf(buffer,"NRPE: Command '%s' not defined",receive_packet.buffer);
605c605
< 				snprintf(buffer,sizeof(buffer)-1,"NRPE: Command timed out after %d seconds\n",command_timeout);
---
> 				sprintf(buffer,"NRPE: Command timed out after %d seconds\n",command_timeout);
607c607
< 				snprintf(buffer,sizeof(buffer)-1,"NRPE: Unable to read output\n");
---
> 				sprintf(buffer,"NRPE: Unable to read output\n");
739c739
< 		snprintf(buffer,sizeof(buffer)-1,"NRPE: Call to fork() failed\n");
---
> 		sprintf(buffer,"NRPE: Call to fork() failed\n");



Of course, this makes one much more vulnerable to buffer overflows: only
run such a binary in a trusted network.

Very likely this hack could be done in a more portable way; I didn't
have the time for this.  Still this might be helpful to other OSF
admins.

Bye,

Joost

-- 
Joost van Baal                            http://abramowitz.uvt.nl/
                                                 Tilburg University
j.e.vanbaal at uvt.nl                                  The Netherlands
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040709/25c5683b/attachment.sig>


More information about the Users mailing list