Ignore:
Timestamp:
May 26, 2011, 6:05:16 PM (8 years ago)
Author:
jmr@…
Message:

ssmtp: fix crash (#27673)

Location:
trunk/dports/mail/ssmtp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/mail/ssmtp/Portfile

    r78913 r78915  
    66name            ssmtp
    77version         2.64
     8revision        1
    89categories      mail
    910maintainers     nomaintainer
     
    2627depends_lib     port:openssl
    2728
    28 patchfiles      patch-ssmtp.c patch-generate_config patch-Makefile.in \
    29                 patch-configure.in 02-557725-solaris.patch
     29patchfiles      02-557725-solaris.patch patch-ssmtp.c patch-generate_config \
     30                patch-Makefile.in patch-configure.in
    3031
    3132use_autoconf    yes
     
    3738post-destroot {
    3839    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    39     xinstall -W ${worksrcpath} README INSTALL COPYING \
     40    xinstall -m 644 -W ${worksrcpath} README INSTALL COPYING \
    4041        ${destroot}${prefix}/share/doc/${name}
    4142
    42     xinstall ${worksrcpath}/ssmtp.conf ${destroot}${prefix}/etc/${name}/ssmtp.conf.sample
     43    xinstall -m 644 ${worksrcpath}/ssmtp.conf ${destroot}${prefix}/etc/${name}/ssmtp.conf.sample
    4344}
  • trunk/dports/mail/ssmtp/files/02-557725-solaris.patch

    r78913 r78915  
    55--- ssmtp.c.orig        2009-11-23 20:55:11.000000000 +1100
    66+++ ssmtp.c     2009-11-24 11:02:02.000000000 +1100
    7 @@ -98,6 +98,26 @@ static char hextab[]="0123456789abcdef";
     7@@ -97,6 +97,26 @@ static char hextab[]="0123456789abcdef";
    88 
    99 ssize_t outbytes;
  • trunk/dports/mail/ssmtp/files/patch-Makefile.in

    r73562 r78915  
    11--- Makefile.in.orig    2008-02-29 13:50:15.000000000 +1100
    2 +++ Makefile.in 2010-11-18 18:25:57.000000000 +1100
     2+++ Makefile.in 2011-05-27 02:59:18.000000000 +1000
    33@@ -18,11 +18,11 @@
    44 CONFIGURATION_FILE=$(SSMTPCONFDIR)/ssmtp.conf
     
    1515 SRCS=ssmtp.c arpadate.c base64.c xgethostname.c @SRCS@
    1616 
     17@@ -47,7 +47,7 @@
     18 .PHONY: install
     19 install: ssmtp $(GEN_CONFIG)
     20        $(INSTALL) -d -m 755 $(bindir)
     21-       $(INSTALL) -s -m 755 ssmtp $(bindir)/ssmtp
     22+       $(INSTALL) -m 755 ssmtp $(bindir)/ssmtp
     23        $(INSTALL) -d -m 755 $(mandir)
     24        $(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(mandir)/ssmtp.8
     25        $(INSTALL) -d -m 755 $(SSMTPCONFDIR)
  • trunk/dports/mail/ssmtp/files/patch-ssmtp.c

    r78913 r78915  
    1 --- ssmtp.c.orig        2009-11-23 20:55:11.000000000 +1100
    2 +++ ssmtp.c     2011-05-27 01:52:00.000000000 +1000
     1--- ssmtp.c.orig        2011-05-27 03:59:39.000000000 +1000
     2+++ ssmtp.c     2011-05-27 04:01:21.000000000 +1000
    33@@ -13,6 +13,7 @@
    44 #define VERSION "2.64"
     
    99 #include <netinet/in.h>
    1010 #include <sys/param.h>
     11@@ -24,6 +25,7 @@
     12 #include <setjmp.h>
     13 #include <string.h>
     14 #include <ctype.h>
     15+#include <libgen.h>
     16 #include <netdb.h>
     17 #ifdef HAVE_SSL
     18 #include <openssl/crypto.h>
     19@@ -2078,6 +2080,8 @@ main() -- make the program behave like s
     20 int main(int argc, char **argv)
     21 {
     22        char **new_argv;
     23+       char *tmp1;
     24+       char *tmp2;
     25 
     26        /* Try to be bulletproof :-) */
     27        (void)signal(SIGHUP, SIG_IGN);
     28@@ -2086,7 +2090,25 @@ int main(int argc, char **argv)
     29        (void)signal(SIGTTOU, SIG_IGN);
     30 
     31        /* Set the globals */
     32-       prog = basename(argv[0]);
     33+       /* basename may write to its input string, so we can't give it argv;
     34+          plus the string it returns isn't permanently malloc'd, so we have to
     35+          make a copy */
     36+       tmp1 = strdup(argv[0]);
     37+       if (!tmp1) {
     38+           perror("strdup");
     39+           die("main: strdup()");
     40+       }
     41+       tmp2 = basename(tmp1);
     42+       if (!tmp2) {
     43+           perror("basename");
     44+           die("main: basename()");
     45+       }
     46+       prog = strdup(tmp2);
     47+       if (!prog) {
     48+           perror("strdup");
     49+           die("main: strdup()");
     50+       }
     51+       free(tmp1);
     52 
     53        hostname = xgethostname();
     54 
Note: See TracChangeset for help on using the changeset viewer.