[78915] trunk/dports/mail/ssmtp
jmr at macports.org
jmr at macports.org
Thu May 26 11:05:16 PDT 2011
Revision: 78915
http://trac.macports.org/changeset/78915
Author: jmr at macports.org
Date: 2011-05-26 11:05:16 -0700 (Thu, 26 May 2011)
Log Message:
-----------
ssmtp: fix crash (#27673)
Modified Paths:
--------------
trunk/dports/mail/ssmtp/Portfile
trunk/dports/mail/ssmtp/files/02-557725-solaris.patch
trunk/dports/mail/ssmtp/files/patch-Makefile.in
trunk/dports/mail/ssmtp/files/patch-ssmtp.c
Modified: trunk/dports/mail/ssmtp/Portfile
===================================================================
--- trunk/dports/mail/ssmtp/Portfile 2011-05-26 16:59:40 UTC (rev 78914)
+++ trunk/dports/mail/ssmtp/Portfile 2011-05-26 18:05:16 UTC (rev 78915)
@@ -5,6 +5,7 @@
name ssmtp
version 2.64
+revision 1
categories mail
maintainers nomaintainer
description Sendmail alternative for small routers (outgoing mail only)
@@ -25,8 +26,8 @@
depends_lib port:openssl
-patchfiles patch-ssmtp.c patch-generate_config patch-Makefile.in \
- patch-configure.in 02-557725-solaris.patch
+patchfiles 02-557725-solaris.patch patch-ssmtp.c patch-generate_config \
+ patch-Makefile.in patch-configure.in
use_autoconf yes
configure.args --enable-ssl
@@ -36,8 +37,8 @@
post-destroot {
xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
- xinstall -W ${worksrcpath} README INSTALL COPYING \
+ xinstall -m 644 -W ${worksrcpath} README INSTALL COPYING \
${destroot}${prefix}/share/doc/${name}
- xinstall ${worksrcpath}/ssmtp.conf ${destroot}${prefix}/etc/${name}/ssmtp.conf.sample
+ xinstall -m 644 ${worksrcpath}/ssmtp.conf ${destroot}${prefix}/etc/${name}/ssmtp.conf.sample
}
Modified: trunk/dports/mail/ssmtp/files/02-557725-solaris.patch
===================================================================
--- trunk/dports/mail/ssmtp/files/02-557725-solaris.patch 2011-05-26 16:59:40 UTC (rev 78914)
+++ trunk/dports/mail/ssmtp/files/02-557725-solaris.patch 2011-05-26 18:05:16 UTC (rev 78915)
@@ -4,7 +4,7 @@
--- ssmtp.c.orig 2009-11-23 20:55:11.000000000 +1100
+++ ssmtp.c 2009-11-24 11:02:02.000000000 +1100
-@@ -98,6 +98,26 @@ static char hextab[]="0123456789abcdef";
+@@ -97,6 +97,26 @@ static char hextab[]="0123456789abcdef";
ssize_t outbytes;
Modified: trunk/dports/mail/ssmtp/files/patch-Makefile.in
===================================================================
--- trunk/dports/mail/ssmtp/files/patch-Makefile.in 2011-05-26 16:59:40 UTC (rev 78914)
+++ trunk/dports/mail/ssmtp/files/patch-Makefile.in 2011-05-26 18:05:16 UTC (rev 78915)
@@ -1,5 +1,5 @@
--- Makefile.in.orig 2008-02-29 13:50:15.000000000 +1100
-+++ Makefile.in 2010-11-18 18:25:57.000000000 +1100
++++ Makefile.in 2011-05-27 02:59:18.000000000 +1000
@@ -18,11 +18,11 @@
CONFIGURATION_FILE=$(SSMTPCONFDIR)/ssmtp.conf
REVALIASES_FILE=$(SSMTPCONFDIR)/revaliases
@@ -14,3 +14,12 @@
SRCS=ssmtp.c arpadate.c base64.c xgethostname.c @SRCS@
+@@ -47,7 +47,7 @@
+ .PHONY: install
+ install: ssmtp $(GEN_CONFIG)
+ $(INSTALL) -d -m 755 $(bindir)
+- $(INSTALL) -s -m 755 ssmtp $(bindir)/ssmtp
++ $(INSTALL) -m 755 ssmtp $(bindir)/ssmtp
+ $(INSTALL) -d -m 755 $(mandir)
+ $(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(mandir)/ssmtp.8
+ $(INSTALL) -d -m 755 $(SSMTPCONFDIR)
Modified: trunk/dports/mail/ssmtp/files/patch-ssmtp.c
===================================================================
--- trunk/dports/mail/ssmtp/files/patch-ssmtp.c 2011-05-26 16:59:40 UTC (rev 78914)
+++ trunk/dports/mail/ssmtp/files/patch-ssmtp.c 2011-05-26 18:05:16 UTC (rev 78915)
@@ -1,5 +1,5 @@
---- ssmtp.c.orig 2009-11-23 20:55:11.000000000 +1100
-+++ ssmtp.c 2011-05-27 01:52:00.000000000 +1000
+--- ssmtp.c.orig 2011-05-27 03:59:39.000000000 +1000
++++ ssmtp.c 2011-05-27 04:01:21.000000000 +1000
@@ -13,6 +13,7 @@
#define VERSION "2.64"
#define _GNU_SOURCE
@@ -8,3 +8,47 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/param.h>
+@@ -24,6 +25,7 @@
+ #include <setjmp.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <libgen.h>
+ #include <netdb.h>
+ #ifdef HAVE_SSL
+ #include <openssl/crypto.h>
+@@ -2078,6 +2080,8 @@ main() -- make the program behave like s
+ int main(int argc, char **argv)
+ {
+ char **new_argv;
++ char *tmp1;
++ char *tmp2;
+
+ /* Try to be bulletproof :-) */
+ (void)signal(SIGHUP, SIG_IGN);
+@@ -2086,7 +2090,25 @@ int main(int argc, char **argv)
+ (void)signal(SIGTTOU, SIG_IGN);
+
+ /* Set the globals */
+- prog = basename(argv[0]);
++ /* basename may write to its input string, so we can't give it argv;
++ plus the string it returns isn't permanently malloc'd, so we have to
++ make a copy */
++ tmp1 = strdup(argv[0]);
++ if (!tmp1) {
++ perror("strdup");
++ die("main: strdup()");
++ }
++ tmp2 = basename(tmp1);
++ if (!tmp2) {
++ perror("basename");
++ die("main: basename()");
++ }
++ prog = strdup(tmp2);
++ if (!prog) {
++ perror("strdup");
++ die("main: strdup()");
++ }
++ free(tmp1);
+
+ hostname = xgethostname();
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110526/c0a26378/attachment.html>
More information about the macports-changes
mailing list