From: <abe...@us...> - 2016-03-15 18:07:02
|
Revision: 7594 http://sourceforge.net/p/astlinux/code/7594 Author: abelbeck Date: 2016-03-15 18:06:59 +0000 (Tue, 15 Mar 2016) Log Message: ----------- monit, version bump to 5.17.1 Modified Paths: -------------- branches/1.0/package/monit/monit-0001-no-force-static.patch branches/1.0/package/monit/monit-0100-localhost-sendmail.patch branches/1.0/package/monit/monit-0110-http-base-url.patch branches/1.0/package/monit/monit.init branches/1.0/package/monit/monit.mk Modified: branches/1.0/package/monit/monit-0001-no-force-static.patch =================================================================== --- branches/1.0/package/monit/monit-0001-no-force-static.patch 2016-03-15 14:26:39 UTC (rev 7593) +++ branches/1.0/package/monit/monit-0001-no-force-static.patch 2016-03-15 18:06:59 UTC (rev 7594) @@ -9,7 +9,7 @@ diff -durN monit-5.7.orig/Makefile.am monit-5.7/Makefile.am --- monit-5.7.orig/Makefile.am 2014-02-20 09:00:42.000000000 +0100 +++ monit-5.7/Makefile.am 2014-09-05 12:49:43.711104001 +0200 -@@ -88,7 +88,7 @@ +@@ -89,7 +89,7 @@ src/ssl/Ssl.c monit_LDADD = libmonit/libmonit.la Modified: branches/1.0/package/monit/monit-0100-localhost-sendmail.patch =================================================================== --- branches/1.0/package/monit/monit-0100-localhost-sendmail.patch 2016-03-15 14:26:39 UTC (rev 7593) +++ branches/1.0/package/monit/monit-0100-localhost-sendmail.patch 2016-03-15 18:06:59 UTC (rev 7594) @@ -1,76 +1,6 @@ ---- monit/src/sendmail.c.orig 2014-12-13 08:14:20.000000000 -0600 -+++ monit/src/sendmail.c 2014-12-13 13:50:02.000000000 -0600 -@@ -205,6 +205,56 @@ - } - - -+void spawn_system_cmd(const char *cmd); -+ -+static FILE *temp_file(char *tmpname) -+{ -+ FILE *p = NULL; -+ int fd; -+ -+ if ((fd = mkstemp(tmpname)) > -1) { -+ fchmod(fd, S_IRUSR | S_IWUSR); -+ if ((p = fdopen(fd, "w+")) == NULL) { -+ close(fd); -+ } -+ } -+ return p; -+} -+ -+ -+static boolean_t sendmail_local(Mail_T mail) { -+ Mail_T m; -+ FILE *p; -+ const char *template = "/tmp/monitmail-XXXXXX"; -+ const char *mailcmd = "/usr/sbin/sendmail -t"; -+ char *tmpname = CALLOC(sizeof(char), strlen(template) + 1); -+ char *system_cmd = CALLOC(sizeof(char), STRLEN); -+ boolean_t failed = false; -+ -+ for (m = mail; m; m = m->next) { -+ strcpy(tmpname, template); -+ if ((p = temp_file(tmpname)) != NULL) { -+ fprintf(p, "From: %s\n", m->from); -+ if (m->replyto) -+ fprintf(p, "Reply-To: %s\n", m->replyto); -+ fprintf(p, "To: %s\n", m->to); -+ fprintf(p, "Subject: %s\n", m->subject); -+ fprintf(p, "\n"); -+ fprintf(p, "%s\n", m->message); -+ fclose(p); -+ snprintf(system_cmd, STRLEN, "( %s < %s ; rm -f %s ) &", mailcmd, tmpname, tmpname); -+ spawn_system_cmd(system_cmd); -+ } else { -+ failed = true; -+ LogError("Mail: Unable to launch '%s' (can't create temporary file)\n", mailcmd); -+ } -+ } -+ -+ FREE(system_cmd); -+ FREE(tmpname); -+ return failed; -+} -+ - /* ------------------------------------------------------------------ Public */ - - -@@ -220,6 +270,10 @@ - - ASSERT(mail); - -+ if (Run.mailservers && strcmp(Run.mailservers->host, "localhost") == 0) { -+ return sendmail_local(mail); -+ } -+ - memset(&S, 0, sizeof(S)); - - TRY --- monit/src/spawn.c.orig 2014-12-13 12:50:23.000000000 -0600 +++ monit/src/spawn.c 2014-12-13 13:16:12.000000000 -0600 -@@ -244,3 +244,89 @@ +@@ -270,3 +270,89 @@ } @@ -160,3 +90,82 @@ + +} + +--- monit-5.17.1/src/alert.c.orig 2016-03-15 11:41:57.000000000 -0500 ++++ monit-5.17.1/src/alert.c 2016-03-15 11:59:12.000000000 -0500 +@@ -151,6 +151,64 @@ + } + + ++static FILE *_temp_file(char *tmpname) ++{ ++ FILE *p = NULL; ++ int fd; ++ ++ if ((fd = mkstemp(tmpname)) > -1) { ++ fchmod(fd, S_IRUSR | S_IWUSR); ++ if ((p = fdopen(fd, "w+")) == NULL) { ++ close(fd); ++ } ++ } ++ return p; ++} ++ ++ ++static boolean_t _sendmail_local(Mail_T mail) { ++ FILE *p; ++ const char *template = "/tmp/monitmail-XXXXXX"; ++ const char *mailcmd = "/usr/sbin/sendmail -t"; ++ char *tmpname = CALLOC(sizeof(char), strlen(template) + 1); ++ char *system_cmd = CALLOC(sizeof(char), STRLEN); ++ boolean_t failed = false; ++ extern void spawn_system_cmd(const char *cmd); ++ ++ for (Mail_T m = mail; m; m = m->next) { ++ strcpy(tmpname, template); ++ if ((p = _temp_file(tmpname)) != NULL) { ++ if (m->from->name) { ++ fprintf(p, "From: \"%s\" <%s>\n", m->from->name, m->from->address); ++ } else { ++ fprintf(p, "From: %s\n", m->from->address); ++ } ++ if (m->replyto) { ++ if (m->replyto->name) { ++ fprintf(p, "Reply-To: \"%s\" <%s>\n", m->replyto->name, m->replyto->address); ++ } else { ++ fprintf(p, "Reply-To: %s\n", m->replyto->address); ++ } ++ } ++ fprintf(p, "To: %s\n", m->to); ++ fprintf(p, "Subject: %s\n", m->subject); ++ fprintf(p, "\n"); ++ fprintf(p, "%s\n", m->message); ++ fclose(p); ++ snprintf(system_cmd, STRLEN, "( %s < %s ; rm -f %s ) &", mailcmd, tmpname, tmpname); ++ spawn_system_cmd(system_cmd); ++ } else { ++ failed = true; ++ LogError("Mail: Unable to launch '%s' (can't create temporary file)\n", mailcmd); ++ } ++ } ++ ++ FREE(system_cmd); ++ FREE(tmpname); ++ return failed; ++} ++ ++ + static boolean_t _sendMail(Mail_T mail) { + ASSERT(mail); + boolean_t failed = false; +@@ -156,6 +156,11 @@ + boolean_t failed = false; + volatile SMTP_T smtp = NULL; + volatile MailServer_T mta = NULL; ++ ++ if (Run.mailservers && strcmp(Run.mailservers->host, "localhost") == 0) { ++ return _sendmail_local(mail); ++ } ++ + TRY + { + mta = _connectMTA(); Modified: branches/1.0/package/monit/monit-0110-http-base-url.patch =================================================================== --- branches/1.0/package/monit/monit-0110-http-base-url.patch 2016-03-15 14:26:39 UTC (rev 7593) +++ branches/1.0/package/monit/monit-0110-http-base-url.patch 2016-03-15 18:06:59 UTC (rev 7594) @@ -9,7 +9,7 @@ #ifdef HAVE_STDIO_H #include <stdio.h> #endif -@@ -521,6 +523,11 @@ +@@ -531,6 +533,11 @@ internal_error(S, SC_BAD_REQUEST, "[error] URL too long"); return NULL; } @@ -18,6 +18,6 @@ + Str_copy(url, url + strlen(HTTP_BASE_URL), strlen(url) - strlen(HTTP_BASE_URL)); + } +#endif + HttpRequest req = NULL; NEW(req); req->S = S; - Util_urlDecode(url); Modified: branches/1.0/package/monit/monit.init =================================================================== --- branches/1.0/package/monit/monit.init 2016-03-15 14:26:39 UTC (rev 7593) +++ branches/1.0/package/monit/monit.init 2016-03-15 18:06:59 UTC (rev 7594) @@ -27,7 +27,7 @@ done if [ -n "$MONIT_NOTIFY_FROM" ]; then - echo "set mail-format { from: $MONIT_NOTIFY_FROM }" + echo "set mail-format { from: \"Monit-$HOSTNAME\" <$MONIT_NOTIFY_FROM> }" fi echo " Modified: branches/1.0/package/monit/monit.mk =================================================================== --- branches/1.0/package/monit/monit.mk 2016-03-15 14:26:39 UTC (rev 7593) +++ branches/1.0/package/monit/monit.mk 2016-03-15 18:06:59 UTC (rev 7594) @@ -4,8 +4,8 @@ # ################################################################################ -MONIT_VERSION = 5.16 -MONIT_SITE = http://mmonit.com/monit/dist +MONIT_VERSION = 5.17.1 +MONIT_SITE = https://mmonit.com/monit/dist MONIT_DEPENDENCIES = host-bison host-flex # # Touching Makefile.am: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |