From: <abe...@us...> - 2016-11-16 18:26:59
|
Revision: 7963 http://sourceforge.net/p/astlinux/code/7963 Author: abelbeck Date: 2016-11-16 18:26:56 +0000 (Wed, 16 Nov 2016) Log Message: ----------- monit, version bump to 5.20.0 Modified Paths: -------------- branches/1.0/package/monit/monit-0001-no-force-static.patch branches/1.0/package/monit/monit-0110-http-base-url.patch branches/1.0/package/monit/monit-0120-style-sheet.patch branches/1.0/package/monit/monit.mk Added Paths: ----------- branches/1.0/package/monit/monit-0100-localhost-sendmail-alert.patch branches/1.0/package/monit/monit-0100-localhost-sendmail-spawn.patch Removed Paths: ------------- branches/1.0/package/monit/monit-0100-localhost-sendmail.patch Modified: branches/1.0/package/monit/monit-0001-no-force-static.patch =================================================================== --- branches/1.0/package/monit/monit-0001-no-force-static.patch 2016-11-15 19:22:06 UTC (rev 7962) +++ branches/1.0/package/monit/monit-0001-no-force-static.patch 2016-11-16 18:26:56 UTC (rev 7963) @@ -9,8 +9,8 @@ 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 -@@ -89,7 +89,7 @@ - src/ssl/Ssl.c +@@ -91,7 +91,7 @@ + src/terminal/Color.c monit_LDADD = libmonit/libmonit.la -monit_LDFLAGS = -static $(EXTLDFLAGS) Added: branches/1.0/package/monit/monit-0100-localhost-sendmail-alert.patch =================================================================== --- branches/1.0/package/monit/monit-0100-localhost-sendmail-alert.patch (rev 0) +++ branches/1.0/package/monit/monit-0100-localhost-sendmail-alert.patch 2016-11-16 18:26:56 UTC (rev 7963) @@ -0,0 +1,85 @@ +--- monit-5.20.0/src/alert.c.orig 2016-03-15 11:41:57.000000000 -0500 ++++ monit-5.20.0/src/alert.c 2016-03-15 11:59:12.000000000 -0500 +@@ -202,6 +202,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 _send(List_T list) { + boolean_t failed = false; + if (List_length(list)) { +@@ -208,6 +266,17 @@ + volatile Mail_T m = NULL; + volatile SMTP_T smtp = NULL; + volatile MailServer_T mta = NULL; ++ ++ if (Run.mailservers && strcmp(Run.mailservers->host, "localhost") == 0) { ++ while ((m = List_pop(list))) { ++ if (_sendmail_local(m) == true) { ++ failed = true; ++ } ++ gc_mail_list((Mail_T *)&m); ++ } ++ return failed; ++ } ++ + TRY + { + mta = _connectMTA(); Added: branches/1.0/package/monit/monit-0100-localhost-sendmail-spawn.patch =================================================================== --- branches/1.0/package/monit/monit-0100-localhost-sendmail-spawn.patch (rev 0) +++ branches/1.0/package/monit/monit-0100-localhost-sendmail-spawn.patch 2016-11-16 18:26:56 UTC (rev 7963) @@ -0,0 +1,92 @@ +--- 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 +@@ -271,3 +271,89 @@ + + } + ++/** ++ * Execute the given command, like spawn() but for a single shell command ++ */ ++void spawn_system_cmd(const char *cmd) { ++ pid_t pid; ++ sigset_t mask; ++ sigset_t save; ++ int stat_loc = 0; ++ int exit_status; ++ ++ /* ++ * Block SIGCHLD ++ */ ++ sigemptyset(&mask); ++ sigaddset(&mask, SIGCHLD); ++ pthread_sigmask(SIG_BLOCK, &mask, &save); ++ ++ pid = fork(); ++ if (pid < 0) { ++ LogError("Cannot fork a new process -- %s\n", STRERROR); ++ pthread_sigmask(SIG_SETMASK, &save, NULL); ++ return; ++ } ++ ++ if (pid == 0) { ++ ++ if (! (Run.flags & Run_Daemon)) { ++ for (int i = 0; i < 3; i++) ++ if (close(i) == -1 || open("/dev/null", O_RDWR) != i) ++ stat_loc |= redirect_ERROR; ++ } ++ ++ Util_closeFds(); ++ ++ setsid(); ++ ++ pid = fork(); ++ if (pid < 0) { ++ stat_loc |= fork_ERROR; ++ _exit(stat_loc); ++ } ++ ++ if (pid == 0) { ++ /* ++ * Reset all signals, so the spawned process is *not* created ++ * with any inherited SIG_BLOCKs ++ */ ++ sigemptyset(&mask); ++ pthread_sigmask(SIG_SETMASK, &mask, NULL); ++ signal(SIGINT, SIG_DFL); ++ signal(SIGHUP, SIG_DFL); ++ signal(SIGTERM, SIG_DFL); ++ signal(SIGUSR1, SIG_DFL); ++ signal(SIGPIPE, SIG_DFL); ++ ++ (void) execl("/bin/sh", "/bin/sh", "-c", cmd, (char *) NULL); ++ _exit(errno); ++ } ++ ++ /* Exit first child and return errors to parent */ ++ _exit(stat_loc); ++ } ++ ++ /* Wait for first child - aka second parent, to exit */ ++ if (waitpid(pid, &stat_loc, 0) != pid) { ++ LogError("Waitpid error\n"); ++ } ++ ++ exit_status = WEXITSTATUS(stat_loc); ++ if (exit_status & fork_ERROR) ++ LogError("Cannot fork a new process for '%s'\n", cmd); ++ if (exit_status & redirect_ERROR) ++ LogError("Cannot redirect IO to /dev/null for '%s'\n", cmd); ++ ++ /* ++ * Restore the signal mask ++ */ ++ pthread_sigmask(SIG_SETMASK, &save, NULL); ++ ++ /* ++ * We do not need to wait for the second child since we forked twice, ++ * the init system-process will wait for it. So we just return ++ */ ++ ++} ++ Deleted: branches/1.0/package/monit/monit-0100-localhost-sendmail.patch =================================================================== --- branches/1.0/package/monit/monit-0100-localhost-sendmail.patch 2016-11-15 19:22:06 UTC (rev 7962) +++ branches/1.0/package/monit/monit-0100-localhost-sendmail.patch 2016-11-16 18:26:56 UTC (rev 7963) @@ -1,171 +0,0 @@ ---- 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 -@@ -270,3 +270,89 @@ - - } - -+/** -+ * Execute the given command, like spawn() but for a single shell command -+ */ -+void spawn_system_cmd(const char *cmd) { -+ pid_t pid; -+ sigset_t mask; -+ sigset_t save; -+ int stat_loc = 0; -+ int exit_status; -+ -+ /* -+ * Block SIGCHLD -+ */ -+ sigemptyset(&mask); -+ sigaddset(&mask, SIGCHLD); -+ pthread_sigmask(SIG_BLOCK, &mask, &save); -+ -+ pid = fork(); -+ if (pid < 0) { -+ LogError("Cannot fork a new process -- %s\n", STRERROR); -+ pthread_sigmask(SIG_SETMASK, &save, NULL); -+ return; -+ } -+ -+ if (pid == 0) { -+ -+ if (! (Run.flags & Run_Daemon)) { -+ for (int i = 0; i < 3; i++) -+ if (close(i) == -1 || open("/dev/null", O_RDWR) != i) -+ stat_loc |= redirect_ERROR; -+ } -+ -+ Util_closeFds(); -+ -+ setsid(); -+ -+ pid = fork(); -+ if (pid < 0) { -+ stat_loc |= fork_ERROR; -+ _exit(stat_loc); -+ } -+ -+ if (pid == 0) { -+ /* -+ * Reset all signals, so the spawned process is *not* created -+ * with any inherited SIG_BLOCKs -+ */ -+ sigemptyset(&mask); -+ pthread_sigmask(SIG_SETMASK, &mask, NULL); -+ signal(SIGINT, SIG_DFL); -+ signal(SIGHUP, SIG_DFL); -+ signal(SIGTERM, SIG_DFL); -+ signal(SIGUSR1, SIG_DFL); -+ signal(SIGPIPE, SIG_DFL); -+ -+ (void) execl("/bin/sh", "/bin/sh", "-c", cmd, (char *) NULL); -+ _exit(errno); -+ } -+ -+ /* Exit first child and return errors to parent */ -+ _exit(stat_loc); -+ } -+ -+ /* Wait for first child - aka second parent, to exit */ -+ if (waitpid(pid, &stat_loc, 0) != pid) { -+ LogError("Waitpid error\n"); -+ } -+ -+ exit_status = WEXITSTATUS(stat_loc); -+ if (exit_status & fork_ERROR) -+ LogError("Cannot fork a new process for '%s'\n", cmd); -+ if (exit_status & redirect_ERROR) -+ LogError("Cannot redirect IO to /dev/null for '%s'\n", cmd); -+ -+ /* -+ * Restore the signal mask -+ */ -+ pthread_sigmask(SIG_SETMASK, &save, NULL); -+ -+ /* -+ * We do not need to wait for the second child since we forked twice, -+ * the init system-process will wait for it. So we just return -+ */ -+ -+} -+ ---- 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-11-15 19:22:06 UTC (rev 7962) +++ branches/1.0/package/monit/monit-0110-http-base-url.patch 2016-11-16 18:26:56 UTC (rev 7963) @@ -9,7 +9,7 @@ #ifdef HAVE_STDIO_H #include <stdio.h> #endif -@@ -531,6 +533,11 @@ +@@ -548,6 +550,11 @@ internal_error(S, SC_BAD_REQUEST, "[error] URL too long"); return NULL; } Modified: branches/1.0/package/monit/monit-0120-style-sheet.patch =================================================================== --- branches/1.0/package/monit/monit-0120-style-sheet.patch 2016-11-15 19:22:06 UTC (rev 7962) +++ branches/1.0/package/monit/monit-0120-style-sheet.patch 2016-11-16 18:26:56 UTC (rev 7963) @@ -1,6 +1,6 @@ --- monit-5.10/src/http/cervlet.c.orig 2014-12-18 15:56:05.000000000 -0600 +++ monit-5.10/src/http/cervlet.c 2014-12-18 15:57:08.000000000 -0600 -@@ -322,10 +322,10 @@ +@@ -519,10 +519,10 @@ " a:hover {text-decoration: none;} "\ " a {text-decoration: underline;color:#222} "\ " table {border-collapse:collapse; border:0;} "\ @@ -14,8 +14,8 @@ + " .green-text {color:#008000;} "\ " .gray-text {color:#999999;} "\ " .blue-text {color:#0000ff;} "\ - " .orange-text {color:#ff8800;} "\ -@@ -335,16 +335,16 @@ + " .yellow-text {color:#ffff00;} "\ +@@ -533,16 +533,16 @@ " /*Opera Fix*/body:before {content:\"\";height:100%%;float:left;width:0;margin-top:-32767px;/} "\ " #footer {position: relative;margin-top: -50px; height: 50px; clear:both; font-size:11px;color:#777;text-align:center;} "\ " #footer a {color:#333;} #footer a:hover {text-decoration: none;} "\ Modified: branches/1.0/package/monit/monit.mk =================================================================== --- branches/1.0/package/monit/monit.mk 2016-11-15 19:22:06 UTC (rev 7962) +++ branches/1.0/package/monit/monit.mk 2016-11-16 18:26:56 UTC (rev 7963) @@ -4,7 +4,7 @@ # ################################################################################ -MONIT_VERSION = 5.17.1 +MONIT_VERSION = 5.20.0 MONIT_SITE = https://mmonit.com/monit/dist MONIT_DEPENDENCIES = host-bison host-flex # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |