[Pkg-nagios-devel] nagios-plugins/debian/patches 16_check_smtp_protocolfix.dpatch, 1.5, 1.6

seanius at haydn.debian.org seanius at haydn.debian.org
Mon Oct 10 07:55:31 UTC 2005


Update of /cvsroot/pkg-nagios/nagios-plugins/debian/patches
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv24417/debian/patches

Modified Files:
	16_check_smtp_protocolfix.dpatch 
Log Message:
...

Index: 16_check_smtp_protocolfix.dpatch
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios-plugins/debian/patches/16_check_smtp_protocolfix.dpatch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- 16_check_smtp_protocolfix.dpatch	10 Oct 2005 07:48:10 -0000	1.5
+++ 16_check_smtp_protocolfix.dpatch	10 Oct 2005 07:55:29 -0000	1.6
@@ -6,8 +6,8 @@
 
 @DPATCH@
 diff -urNad nagios-plugins~/plugins/check_smtp.c nagios-plugins/plugins/check_smtp.c
---- nagios-plugins~/plugins/check_smtp.c	2005-10-10 09:42:59.000000000 +0200
-+++ nagios-plugins/plugins/check_smtp.c	2005-10-10 09:45:34.000000000 +0200
+--- nagios-plugins~/plugins/check_smtp.c	2005-10-10 09:52:49.000000000 +0200
++++ nagios-plugins/plugins/check_smtp.c	2005-10-10 09:54:53.000000000 +0200
 @@ -59,10 +59,17 @@
  enum {
  	SMTP_PORT	= 25
@@ -40,7 +40,7 @@
  int sd;
  char buffer[MAX_INPUT_BUFFER];
  enum {
-@@ -112,14 +122,16 @@
+@@ -112,7 +122,7 @@
  int
  main (int argc, char **argv)
  {
@@ -49,17 +49,15 @@
  	int n = 0;
  	double elapsed_time;
  	long microsec;
--	int result = STATE_UNKNOWN;
-+	int amt_read=0, result = STATE_UNKNOWN;
+@@ -120,6 +130,7 @@
  	char *cmd_str = NULL;
  	char *helocmd = NULL;
-+	char *ehlo_resp = NULL;
  	struct timeval tv;
 +	struct hostent *hp;
  
  	setlocale (LC_ALL, "");
  	bindtextdomain (PACKAGE, LOCALEDIR);
-@@ -129,12 +141,19 @@
+@@ -129,12 +140,26 @@
  		usage4 (_("Could not parse arguments"));
  
  	/* initialize the HELO command with the localhostname */
@@ -71,7 +69,14 @@
 -	asprintf (&helocmd, "%s%s%s", SMTP_HELO, helocmd, "\r\n");
 +	if(! localhostname){
 +		localhostname = malloc (HOST_MAX_BYTES);
-+		gethostname(localhostname, HOST_MAX_BYTES);
++		if(!localhostname){
++			printf(_("malloc() failed!\n"));
++			return STATE_CRITICAL;
++		}
++		if(gethostname(localhostname, HOST_MAX_BYTES)){
++			printf(_("gethostname() failed!\n"));
++			return STATE_CRITICAL;
++		}
 +		hp = gethostbyname(localhostname);
 +		if(!hp) helocmd = localhostname;
 +		else helocmd = hp->h_name;
@@ -85,7 +90,7 @@
  
  	/* initialize the MAIL command with optional FROM command  */
  	asprintf (&cmd_str, "%sFROM: %s%s", mail_command, from_arg, "\r\n");
-@@ -178,11 +197,26 @@
+@@ -178,11 +203,26 @@
  			}
  		}
  
@@ -114,7 +119,7 @@
  
  #ifdef HAVE_SSL
  		if(use_ssl) {
-@@ -192,11 +226,14 @@
+@@ -192,11 +232,14 @@
  		  recv(sd,buffer, MAX_INPUT_BUFFER-1, 0); /* wait for it */
  		  if (!strstr (buffer, server_expect)) {
  		    printf (_("Server does not support STARTTLS\n"));
@@ -129,7 +134,7 @@
  		  }
  		  if ( check_cert ) {
  		    if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) {
-@@ -333,6 +370,7 @@
+@@ -333,6 +376,7 @@
  		{"timeout", required_argument, 0, 't'},
  		{"port", required_argument, 0, 'p'},
  		{"from", required_argument, 0, 'f'},
@@ -137,7 +142,7 @@
  		{"command", required_argument, 0, 'C'},
  		{"response", required_argument, 0, 'R'},
  		{"nocommand", required_argument, 0, 'n'},
-@@ -359,7 +397,7 @@
+@@ -359,7 +403,7 @@
  	}
  
  	while (1) {
@@ -146,7 +151,7 @@
  		                 longopts, &option);
  
  		if (c == -1 || c == EOF)
-@@ -380,6 +418,10 @@
+@@ -380,6 +424,10 @@
  			else
  				usage4 (_("Port must be a positive integer"));
  			break;
@@ -157,7 +162,7 @@
  		case 'f':									/* from argument */
  			from_arg = optarg;
  			smtp_use_dummycmd = 1;
-@@ -439,6 +481,7 @@
+@@ -439,6 +487,7 @@
  		case 'S':
  		/* starttls */
  			use_ssl = TRUE;
@@ -165,7 +170,7 @@
  			break;
  		case 'D':
  		/* Check SSL cert validity */
-@@ -581,7 +624,7 @@
+@@ -581,7 +630,7 @@
  
    /* Initialize SSL context */
    SSLeay_add_ssl_algorithms ();
@@ -174,7 +179,7 @@
    SSL_load_error_strings ();
    if ((ctx = SSL_CTX_new (meth)) == NULL)
      {
-@@ -602,11 +645,6 @@
+@@ -602,11 +651,6 @@
      {
        printf (_("CRITICAL - Cannot initiate SSL handshake.\n"));
      }
@@ -186,7 +191,7 @@
    my_close();
    
    return STATE_CRITICAL;
-@@ -708,7 +746,7 @@
+@@ -708,7 +752,7 @@
  my_close (void)
  {
  #ifdef HAVE_SSL




More information about the Pkg-nagios-devel mailing list