diff options
author | obache <obache> | 2006-10-09 12:46:01 +0000 |
---|---|---|
committer | obache <obache> | 2006-10-09 12:46:01 +0000 |
commit | c35eb6743ef3563e86a004db5a111c8efc1ec26e (patch) | |
tree | ab9ca4305baef7cd8e23c9ecd81e4bdc4114612c /mail/cyrus-imapd | |
parent | 592c4d6e59716a8ca4959d5e22172908d553f170 (diff) | |
download | pkgsrc-c35eb6743ef3563e86a004db5a111c8efc1ec26e.tar.gz |
Add patch to imap/backend.c(r1.38), diff came from cyrus cvs repository.
r1.39: initialize err to revent segfault
r1.40: only free() the backend struct if we allocated it (don't free cached connections)
Bump PKGREVISION.
Diffstat (limited to 'mail/cyrus-imapd')
-rw-r--r-- | mail/cyrus-imapd/Makefile | 3 | ||||
-rw-r--r-- | mail/cyrus-imapd/distinfo | 3 | ||||
-rw-r--r-- | mail/cyrus-imapd/patches/patch-ae | 80 |
3 files changed, 84 insertions, 2 deletions
diff --git a/mail/cyrus-imapd/Makefile b/mail/cyrus-imapd/Makefile index 911681d1822..3906f1fe767 100644 --- a/mail/cyrus-imapd/Makefile +++ b/mail/cyrus-imapd/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.66 2006/10/04 21:47:16 wiz Exp $ +# $NetBSD: Makefile,v 1.67 2006/10/09 12:46:01 obache Exp $ DISTNAME= cyrus-imapd-2.2.13 +PKGREVISION= 1 CATEGORIES= mail MASTER_SITES= ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ \ ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/OLD-VERSIONS/imap/ diff --git a/mail/cyrus-imapd/distinfo b/mail/cyrus-imapd/distinfo index 39e0dbc85ed..208b0b2031d 100644 --- a/mail/cyrus-imapd/distinfo +++ b/mail/cyrus-imapd/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.23 2006/10/04 12:18:14 obache Exp $ +$NetBSD: distinfo,v 1.24 2006/10/09 12:46:01 obache Exp $ SHA1 (cyrus-imapd-2.2.13.tar.gz) = ba84b67a1cae4c15d5a588d010764031167970c4 RMD160 (cyrus-imapd-2.2.13.tar.gz) = 7e8ac84b5ddd9f1206e71d5b659d07d8400f9ac2 @@ -7,6 +7,7 @@ SHA1 (patch-aa) = 379da5df874f3514d654d895e8b8e56a6f26c63d SHA1 (patch-ab) = 986fa32dd6acc088779791b7bdabde5981b61bc1 SHA1 (patch-ac) = 48557e05ef0d82413da18dd46d9c4baf802a771d SHA1 (patch-ad) = e99638a062b2695514c6859788eac3fd02cf5c1d +SHA1 (patch-ae) = b1865b68a8f798a3766e53e60e9e68099df9bd54 SHA1 (patch-af) = de3c788417eaf8d7febd4903af4828c9a6e63e3d SHA1 (patch-al) = 6fa8967eb97f7cfdb93de86a45aa90ab3a1bd129 SHA1 (patch-am) = 0804e6fa6694ed820861b740ac1bead29b3eeb4b diff --git a/mail/cyrus-imapd/patches/patch-ae b/mail/cyrus-imapd/patches/patch-ae new file mode 100644 index 00000000000..02384394cec --- /dev/null +++ b/mail/cyrus-imapd/patches/patch-ae @@ -0,0 +1,80 @@ +$NetBSD: patch-ae,v 1.6 2006/10/09 12:46:01 obache Exp $ + +--- imap/backend.c.orig 2006-02-08 05:57:27.000000000 +0900 ++++ imap/backend.c +@@ -264,25 +264,28 @@ static void timed_out(int sig) + } + } + +-struct backend *backend_connect(struct backend *ret, const char *server, ++struct backend *backend_connect(struct backend *ret_backend, const char *server, + struct protocol_t *prot, const char *userid, + const char **auth_status) + { + /* need to (re)establish connection to server or create one */ + int sock = -1; + int r; +- int err = 0; ++ int err = -1; + struct addrinfo hints, *res0 = NULL, *res1 = NULL, *res; + struct sockaddr_un sunsock; + char buf[2048], *mechlist = NULL; + struct sigaction action; ++ struct backend *ret; + +- if (!ret) { ++ if (!ret_backend) { + ret = xmalloc(sizeof(struct backend)); + memset(ret, 0, sizeof(struct backend)); + strlcpy(ret->hostname, server, sizeof(ret->hostname)); + ret->timeout = NULL; + } ++ else ++ ret = ret_backend; + + if (server[0] == '/') { /* unix socket */ + res0 = &hints; +@@ -312,7 +315,7 @@ struct backend *backend_connect(struct b + if (err) { + syslog(LOG_ERR, "getaddrinfo(%s) failed: %s", + server, gai_strerror(err)); +- free(ret); ++ if (!ret_backend) free(ret); + return NULL; + } + /* Get addrinfo struct for local interface. */ +@@ -363,7 +366,7 @@ struct backend *backend_connect(struct b + if (res0 != &hints) + freeaddrinfo(res0); + syslog(LOG_ERR, "connect(%s) failed: %m", server); +- free(ret); ++ if (!ret_backend) free(ret); + return NULL; + } + memcpy(&ret->addr, res->ai_addr, res->ai_addrlen); +@@ -381,7 +384,7 @@ struct backend *backend_connect(struct b + syslog(LOG_ERR, + "backend_connect(): couldn't read initial greeting: %s", + ret->in->error ? ret->in->error : "(null)"); +- free(ret); ++ if (!ret_backend) free(ret); + close(sock); + return NULL; + } +@@ -396,13 +399,15 @@ struct backend *backend_connect(struct b + if ((r = backend_authenticate(ret, prot, &mechlist, userid, auth_status))) { + syslog(LOG_ERR, "couldn't authenticate to backend server: %s", + sasl_errstring(r, NULL, NULL)); +- free(ret); ++ if (!ret_backend) free(ret); + close(sock); + ret = NULL; + } + } + + if (mechlist) free(mechlist); ++ ++ if (!ret_backend) ret_backend = ret; + + return ret; + } |