Ethan Galstad 23 lat temu
rodzic
commit
1b08e9953a
8 zmienionych plików z 25 dodań i 30 usunięć
  1. 2 2
      common/common.h
  2. 2 2
      configure
  3. 2 2
      configure.in
  4. 1 1
      nrpe.spec
  5. 2 2
      src/check_nrpe.c
  6. 6 6
      src/dh.h
  7. 7 12
      src/nrpe.c
  8. 3 3
      src/utils.c

+ 2 - 2
common/common.h

@@ -23,8 +23,8 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#define PROGRAM_VERSION "2.0b1"
-#define MODIFICATION_DATE "04-03-2003"
+#define PROGRAM_VERSION "2.0b2"
+#define MODIFICATION_DATE "04-15-2003"
 
 
 #define OK		0
 #define OK		0
 #define ERROR		-1
 #define ERROR		-1

+ 2 - 2
configure

@@ -535,9 +535,9 @@ fi
 
 
 
 
 PKG_NAME=nrpe
 PKG_NAME=nrpe
-PKG_VERSION="2.0b1"
+PKG_VERSION="2.0b2"
 PKG_HOME_URL="http://www.nagios.org/"
 PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="04-03-2003"
+PKG_REL_DATE="04-15-2003"
 
 
 
 
 ac_aux_dir=
 ac_aux_dir=

+ 2 - 2
configure.in

@@ -9,9 +9,9 @@ AC_CONFIG_HEADER(common/config.h)
 AC_PREFIX_DEFAULT(/usr/local/nagios)
 AC_PREFIX_DEFAULT(/usr/local/nagios)
 
 
 PKG_NAME=nrpe
 PKG_NAME=nrpe
-PKG_VERSION="2.0b1"
+PKG_VERSION="2.0b2"
 PKG_HOME_URL="http://www.nagios.org/"
 PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="04-03-2003"
+PKG_REL_DATE="04-15-2003"
 
 
 dnl Figure out how to invoke "install" and what install options to use.
 dnl Figure out how to invoke "install" and what install options to use.
 
 

+ 1 - 1
nrpe.spec

@@ -1,5 +1,5 @@
 %define name nrpe
 %define name nrpe
-%define version 2.0b1
+%define version 2.0b2
 %define release 1
 %define release 1
 %define nsusr nagios
 %define nsusr nagios
 %define nsgrp nagios
 %define nsgrp nagios

+ 2 - 2
src/check_nrpe.c

@@ -4,7 +4,7 @@
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * License: GPL
  * License: GPL
  *
  *
- * Last Modified: 04-03-2003
+ * Last Modified: 04-15-2003
  *
  *
  * Command line: CHECK_NRPE -H <host_address> [-p port] [-c command] [-to to_sec]
  * Command line: CHECK_NRPE -H <host_address> [-p port] [-c command] [-to to_sec]
  *
  *
@@ -53,7 +53,7 @@ void alarm_handler(int);
 
 
 
 
 int main(int argc, char **argv){
 int main(int argc, char **argv){
-        u_int32_t long packet_crc32;
+        u_int32_t packet_crc32;
         u_int32_t calculated_crc32;
         u_int32_t calculated_crc32;
 	int16_t result;
 	int16_t result;
 	int rc;
 	int rc;

+ 6 - 6
src/dh.h

@@ -4,12 +4,12 @@
 DH *get_dh512()
 DH *get_dh512()
 	{
 	{
 	static unsigned char dh512_p[]={
 	static unsigned char dh512_p[]={
-		0x88,0x7D,0x5A,0x39,0x4D,0x73,0x56,0x07,0x30,0x08,0xBF,0x37,
-		0xBD,0x8A,0x52,0x55,0x36,0xA0,0x86,0x99,0xB7,0x2E,0xE0,0x10,
-		0x2D,0xF7,0x75,0xAC,0x38,0xB7,0xCC,0x07,0x8E,0x03,0x7B,0xE1,
-		0xB7,0xC2,0xA9,0x5D,0x10,0x2D,0x0A,0x85,0x2B,0x0E,0x71,0x3F,
-		0xA7,0xB7,0xC7,0xCE,0xCE,0x73,0xC3,0x7F,0x92,0x51,0x41,0xD3,
-		0xED,0xD1,0x06,0x93,
+		0xFC,0xAF,0x5F,0xF7,0xB2,0xE7,0x1B,0xD6,0x93,0x85,0x86,0x47,
+		0x3D,0xE9,0x04,0x74,0x05,0x81,0xF8,0xC1,0x0D,0xA3,0xA1,0xAD,
+		0x84,0xD0,0x14,0xAE,0x56,0xD2,0x0E,0xF2,0xCD,0x8C,0x92,0x09,
+		0xDE,0xB4,0x4D,0x5F,0xA1,0x17,0x09,0xF4,0x75,0x4E,0xBA,0xE9,
+		0x30,0x3B,0x79,0xDA,0x79,0x7E,0x2E,0xE6,0x2D,0x95,0x48,0x74,
+		0x04,0xDE,0x53,0x3B,
 		};
 		};
 	static unsigned char dh512_g[]={
 	static unsigned char dh512_g[]={
 		0x02,
 		0x02,

+ 7 - 12
src/nrpe.c

@@ -4,7 +4,7 @@
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * License: GPL
  * License: GPL
  *
  *
- * Last Modified: 04-03-2003
+ * Last Modified: 04-15-2003
  *
  *
  * Command line: nrpe -c <config_file> [--inetd | --daemon]
  * Command line: nrpe -c <config_file> [--inetd | --daemon]
  *
  *
@@ -85,8 +85,7 @@ int use_ssl=FALSE;
 
 
 
 
 int main(int argc, char **argv){
 int main(int argc, char **argv){
-	int error=FALSE;
-	int result;
+	int result=OK;
 	int x;
 	int x;
 	char buffer[MAX_INPUT_BUFFER];
 	char buffer[MAX_INPUT_BUFFER];
 #ifdef HAVE_SSL
 #ifdef HAVE_SSL
@@ -270,7 +269,6 @@ int read_config_file(char *filename){
 	char *varname;
 	char *varname;
 	char *varvalue;
 	char *varvalue;
 	int line;
 	int line;
-	int x;
 
 
 
 
 	/* open the config file for reading */
 	/* open the config file for reading */
@@ -516,7 +514,8 @@ void wait_for_connections(void){
 	struct sockaddr_in *nptr;
 	struct sockaddr_in *nptr;
 	struct sockaddr addr;
 	struct sockaddr addr;
 	int rc;
 	int rc;
-	int sock, new_sd, addrlen;
+	int sock, new_sd;
+	socklen_t addrlen;
 	char connecting_host[16];
 	char connecting_host[16];
 	pid_t pid;
 	pid_t pid;
 	int flag=1;
 	int flag=1;
@@ -703,12 +702,11 @@ void handle_connection(int sock){
 	int early_timeout=FALSE;
 	int early_timeout=FALSE;
 	int rc;
 	int rc;
 	int x;
 	int x;
-	FILE *fp;
 #ifdef DEBUG
 #ifdef DEBUG
 	FILE *errfp;
 	FILE *errfp;
 #endif
 #endif
 #ifdef HAVE_SSL
 #ifdef HAVE_SSL
-	SSL *ssl;
+	SSL *ssl=NULL;
 #endif
 #endif
 
 
 
 
@@ -727,7 +725,7 @@ void handle_connection(int sock){
 		if((ssl=SSL_new(ctx))!=NULL){
 		if((ssl=SSL_new(ctx))!=NULL){
 			SSL_set_fd(ssl,sock);
 			SSL_set_fd(ssl,sock);
 			if((rc=SSL_accept(ssl))!=1){
 			if((rc=SSL_accept(ssl))!=1){
-				syslog(LOG_ERR,"Error: Could not complete SSL handshake. %s\n",SSL_get_error(ssl,rc));
+				syslog(LOG_ERR,"Error: Could not complete SSL handshake. %d\n",SSL_get_error(ssl,rc));
 #ifdef DEBUG
 #ifdef DEBUG
 				errfp=fopen("/tmp/err.log","w");
 				errfp=fopen("/tmp/err.log","w");
 				ERR_print_errors_fp(errfp);
 				ERR_print_errors_fp(errfp);
@@ -1258,10 +1256,9 @@ int check_privileges(void){
 
 
 /* tests whether or not a client request is valid */
 /* tests whether or not a client request is valid */
 int validate_request(packet *pkt){
 int validate_request(packet *pkt){
-        u_int32_t long packet_crc32;
+        u_int32_t packet_crc32;
         u_int32_t calculated_crc32;
         u_int32_t calculated_crc32;
 	char *ptr;
 	char *ptr;
-	int x;
 
 
 
 
 	/***** DECRYPT REQUEST ******/
 	/***** DECRYPT REQUEST ******/
@@ -1431,9 +1428,7 @@ int process_macros(char *input_buffer,char *output_buffer,int buffer_length){
 /* process command line arguments */
 /* process command line arguments */
 int process_arguments(int argc, char **argv){
 int process_arguments(int argc, char **argv){
 	char optchars[MAX_INPUT_BUFFER];
 	char optchars[MAX_INPUT_BUFFER];
-	int argindex=0;
 	int c=1;
 	int c=1;
-	int i=1;
 	int have_mode=FALSE;
 	int have_mode=FALSE;
 
 
 #ifdef HAVE_GETOPT_H
 #ifdef HAVE_GETOPT_H

+ 3 - 3
src/utils.c

@@ -5,7 +5,7 @@
  * License: GPL
  * License: GPL
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  *
  *
- * Last Modified: 01-28-2003
+ * Last Modified: 04-15-2003
  *
  *
  * Description:
  * Description:
  *
  *
@@ -302,7 +302,7 @@ void strip(char *buffer){
 int sendall(int s, char *buf, int *len){
 int sendall(int s, char *buf, int *len){
 	int total=0;
 	int total=0;
 	int bytesleft=*len;
 	int bytesleft=*len;
-	int n;
+	int n=0;
 
 
 	/* send all the data */
 	/* send all the data */
 	while(total<*len){
 	while(total<*len){
@@ -331,7 +331,7 @@ int sendall(int s, char *buf, int *len){
 int recvall(int s, char *buf, int *len, int timeout){
 int recvall(int s, char *buf, int *len, int timeout){
 	int total=0;
 	int total=0;
 	int bytesleft=*len;
 	int bytesleft=*len;
-	int n;
+	int n=0;
 	time_t start_time;
 	time_t start_time;
 	time_t current_time;
 	time_t current_time;