2
## 63_nomorecrashongnutlserror.dpatch by Philip Hazel <ph10@cus.cam.ac.uk>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Fix unitialized variable and a thinko in tls-gnu.c.
7
## DP: Pulled from 4.40
8
## DP: 18. If a server dropped the connection unexpectedly when an Exim client
9
## DP: was using GnuTLS and trying to read a response, the client delivery
10
## DP: process crashed while trying to generate an error log message.
14
echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
18
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
19
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
22
-patch) patch -p1 ${patch_opts} < $0;;
23
-unpatch) patch -R -p1 ${patch_opts} < $0;;
25
echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
32
Index: 4exp-exim/src/tls-gnu.c
33
===================================================================
34
RCS file: /cvsroot/pkg-exim4/exim/exim/src/tls-gnu.c,v
35
retrieving revision 1.5
36
retrieving revision 1.6
38
--- 4exp-exim/src/tls-gnu.c 5 May 2004 16:34:08 -0000 1.5
39
+++ 4exp-exim/src/tls-gnu.c 9 Nov 2004 12:25:05 -0000 1.6
42
DEBUG(D_tls) debug_printf("initializing GnuTLS as a client\n");
45
verify_requirement = (verify_certs == NULL)? VERIFY_NONE : VERIFY_REQUIRED;
46
rc = tls_init(host, certificate, privatekey, verify_certs, verify_crl);
47
if (rc != OK) return rc;
49
record_io_error(int ec, uschar *when, uschar *text)
51
uschar *additional = US"";
53
if (ec == GNUTLS_E_FATAL_ALERT_RECEIVED)
54
additional = string_sprintf(": %s",
55
gnutls_alert_get_name(gnutls_alert_get(tls_session)));
58
log_write(0, LOG_MAIN, "TLS %s error on connection to %s [%s]: %s%s", when,
59
client_host->name, client_host->address,
60
- (text == 0)? text : US gnutls_strerror(ec), additional);
61
+ (ec == 0)? text : US gnutls_strerror(ec), additional);
67
inbytes = gnutls_record_recv(tls_session, CS buff, len);
68
if (inbytes > 0) return inbytes;
72
DEBUG(D_tls) debug_printf("Got TLS_EOF\n");