summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2007-03-06 22:29:27 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2007-03-06 22:29:27 (GMT)
commitcf2ba0769c55dc4d0eeb5f4d71b9f422ab0edcfc (patch)
treea6693e066e42cc989ba0befde76ac67fa59b8e23 /plugins
parent1db33136b0e4176848e202281b4a054a7ed71533 (diff)
downloadmonitoring-plugins-cf2ba0769c55dc4d0eeb5f4d71b9f422ab0edcfc.tar.gz
Fixed compile errors in check_smtp.c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1631 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_smtp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 6987e17..5001b50 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -169,7 +169,7 @@ main (int argc, char **argv)
169 int result = STATE_UNKNOWN; 169 int result = STATE_UNKNOWN;
170 char *cmd_str = NULL; 170 char *cmd_str = NULL;
171 char *helocmd = NULL; 171 char *helocmd = NULL;
172 char *error_msg = NULL; 172 char *error_msg = "";
173 struct timeval tv; 173 struct timeval tv;
174 174
175 setlocale (LC_ALL, ""); 175 setlocale (LC_ALL, "");
@@ -380,12 +380,12 @@ main (int argc, char **argv)
380 do { 380 do {
381 if (authuser == NULL) { 381 if (authuser == NULL) {
382 result = STATE_CRITICAL; 382 result = STATE_CRITICAL;
383 error_msg = _("no authuser specified, "); 383 asprintf(&error_msg, _("no authuser specified, "));
384 break; 384 break;
385 } 385 }
386 if (authpass == NULL) { 386 if (authpass == NULL) {
387 result = STATE_CRITICAL; 387 result = STATE_CRITICAL;
388 error_msg = _("no authpass specified, "); 388 asprintf(&error_msg, _("no authpass specified, "));
389 break; 389 break;
390 } 390 }
391 391
@@ -395,7 +395,7 @@ main (int argc, char **argv)
395 printf (_("sent %s\n"), "AUTH LOGIN"); 395 printf (_("sent %s\n"), "AUTH LOGIN");
396 396
397 if((ret = my_recv(buffer, MAXBUF - 1)) < 0){ 397 if((ret = my_recv(buffer, MAXBUF - 1)) < 0){
398 error_msg = _("recv() failed after AUTH LOGIN, \n"); 398 asprintf(&error_msg, _("recv() failed after AUTH LOGIN, "));
399 result = STATE_WARNING; 399 result = STATE_WARNING;
400 break; 400 break;
401 } 401 }
@@ -405,7 +405,7 @@ main (int argc, char **argv)
405 405
406 if (strncmp (buffer, "334", 3) != 0) { 406 if (strncmp (buffer, "334", 3) != 0) {
407 result = STATE_CRITICAL; 407 result = STATE_CRITICAL;
408 error_msg = _("invalid response received after AUTH LOGIN, "); 408 asprintf(&error_msg, _("invalid response received after AUTH LOGIN, "));
409 break; 409 break;
410 } 410 }
411 411
@@ -418,7 +418,7 @@ main (int argc, char **argv)
418 418
419 if ((ret = my_recv(buffer, MAX_INPUT_BUFFER-1)) == -1) { 419 if ((ret = my_recv(buffer, MAX_INPUT_BUFFER-1)) == -1) {
420 result = STATE_CRITICAL; 420 result = STATE_CRITICAL;
421 error_msg = _("recv() failed after sending authuser, "); 421 asprintf(&error_msg, _("recv() failed after sending authuser, "));
422 break; 422 break;
423 } 423 }
424 buffer[ret] = 0; 424 buffer[ret] = 0;
@@ -427,7 +427,7 @@ main (int argc, char **argv)
427 } 427 }
428 if (strncmp (buffer, "334", 3) != 0) { 428 if (strncmp (buffer, "334", 3) != 0) {
429 result = STATE_CRITICAL; 429 result = STATE_CRITICAL;
430 error_msg = _("invalid response received after authuser, "); 430 asprintf(&error_msg, _("invalid response received after authuser, "));
431 break; 431 break;
432 } 432 }
433 /* encode authpass with base64 */ 433 /* encode authpass with base64 */
@@ -439,7 +439,7 @@ main (int argc, char **argv)
439 } 439 }
440 if ((ret = my_recv(buffer, MAX_INPUT_BUFFER-1)) == -1) { 440 if ((ret = my_recv(buffer, MAX_INPUT_BUFFER-1)) == -1) {
441 result = STATE_CRITICAL; 441 result = STATE_CRITICAL;
442 error_msg = _("recv() failed after sending authpass, "); 442 asprintf(&error_msg, _("recv() failed after sending authpass, "));
443 break; 443 break;
444 } 444 }
445 buffer[ret] = 0; 445 buffer[ret] = 0;
@@ -448,14 +448,14 @@ main (int argc, char **argv)
448 } 448 }
449 if (strncmp (buffer, "235", 3) != 0) { 449 if (strncmp (buffer, "235", 3) != 0) {
450 result = STATE_CRITICAL; 450 result = STATE_CRITICAL;
451 error_msg = _("invalid response received after authpass, "); 451 asprintf(&error_msg, _("invalid response received after authpass, "));
452 break; 452 break;
453 } 453 }
454 break; 454 break;
455 } while (0); 455 } while (0);
456 } else { 456 } else {
457 result = STATE_CRITICAL; 457 result = STATE_CRITICAL;
458 error_msg = _("only authtype LOGIN is supported, "); 458 asprintf(&error_msg, _("only authtype LOGIN is supported, "));
459 } 459 }
460 } 460 }
461 461
@@ -481,7 +481,7 @@ main (int argc, char **argv)
481 481
482 printf (_("SMTP %s - %s%.3f sec. response time%s%s|%s\n"), 482 printf (_("SMTP %s - %s%.3f sec. response time%s%s|%s\n"),
483 state_text (result), 483 state_text (result),
484 (error_msg == NULL ? "" : error_msg), 484 error_msg,
485 elapsed_time, 485 elapsed_time,
486 verbose?", ":"", verbose?buffer:"", 486 verbose?", ":"", verbose?buffer:"",
487 fperfdata ("time", elapsed_time, "s", 487 fperfdata ("time", elapsed_time, "s",