summaryrefslogtreecommitdiffstats
path: root/web/attachments/417469-check_smtp.c.patch
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
commit0b6423f9c99d9edf8c96fefd0f6c453859395aa1 (patch)
tree1c2b6b21704a294940f87c7892676998d8371707 /web/attachments/417469-check_smtp.c.patch
downloadsite-0b6423f9c99d9edf8c96fefd0f6c453859395aa1.tar.gz
Import Nagios Plugins site
Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files.
Diffstat (limited to 'web/attachments/417469-check_smtp.c.patch')
-rw-r--r--web/attachments/417469-check_smtp.c.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/web/attachments/417469-check_smtp.c.patch b/web/attachments/417469-check_smtp.c.patch
new file mode 100644
index 0000000..3c6a812
--- /dev/null
+++ b/web/attachments/417469-check_smtp.c.patch
@@ -0,0 +1,36 @@
1diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
2index ed49163..80cc0eb 100644
3--- a/plugins/check_smtp.c
4+++ b/plugins/check_smtp.c
5@@ -129,6 +129,9 @@ main (int argc, char **argv)
6 char *error_msg = "";
7 struct timeval tv;
8
9+ /* catch pipe errors in read.write */
10+ (void) signal (SIGPIPE, SIG_IGN);
11+
12 setlocale (LC_ALL, "");
13 bindtextdomain (PACKAGE, LOCALEDIR);
14 textdomain (PACKAGE);
15@@ -662,8 +665,20 @@ void
16 smtp_quit(void)
17 {
18 int bytes;
19+ int n;
20+
21+ n = my_send(SMTP_QUIT, strlen(SMTP_QUIT));
22+ if(n != 0) {
23+ if(verbose) {
24+ /* Not sure this is really an unknown state so just print out instead
25+ die (STATE_UNKNOWN,
26+ */
27+ printf(
28+ _("Connection was closed by server before we could send QUIT command\n"));
29+ }
30+ return;
31+ }
32
33- my_send(SMTP_QUIT, strlen(SMTP_QUIT));
34 if (verbose)
35 printf(_("sent %s\n"), "QUIT");
36