Package: ssmtp / 2.64-8

02-557725-solaris.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557725

Patch by Darik Horn <dajhorn@vanadac.com>

Index: ssmtp-2.64/generate_config
===================================================================
--- ssmtp-2.64.orig/generate_config
+++ ssmtp-2.64/generate_config
@@ -1,10 +1,16 @@
-#!/bin/sh -e
+#!/bin/bash -e
 
 #
 # Figure out the system's mailname
 #
 
-syshostname=`hostname --fqdn`
+if test `uname` == 'SunOS'
+then
+	syshostname=`uname -n`
+else
+	syshostname=`hostname --fqdn`
+fi
+
 if test -f /etc/mailname
 then
 	mailname="`head -1 /etc/mailname`"
Index: ssmtp-2.64/ssmtp.c
===================================================================
--- ssmtp-2.64.orig/ssmtp.c
+++ ssmtp-2.64/ssmtp.c
@@ -93,6 +93,20 @@ static char hextab[]="0123456789abcdef";
 
 ssize_t outbytes;
 
+#if defined (__SVR4) && defined (__sun)
+/*
+strndup() - Unimplemented by the Solaris libc.
+*/
+char * strndup(char const *s, size_t n)
+{
+	size_t len = strnlen(s, n);
+	char *new = malloc(len + 1);
+	if(new == NULL) return NULL;
+	new[len] = '\0';
+	return memcpy(new, s, len);
+}
+#endif
+
 /*
 log_event() -- Write event to syslog (or log file if defined)
 */