pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/cyrus-imapd Add patch to imap/backend.c(r1.38), d...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cc176d023d0a
branches:  trunk
changeset: 519768:cc176d023d0a
user:      obache <obache%pkgsrc.org@localhost>
date:      Mon Oct 09 12:46:01 2006 +0000

description:
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:

 mail/cyrus-imapd/Makefile         |   3 +-
 mail/cyrus-imapd/distinfo         |   3 +-
 mail/cyrus-imapd/patches/patch-ae |  80 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 2 deletions(-)

diffs (113 lines):

diff -r 87a6f4be18ec -r cc176d023d0a mail/cyrus-imapd/Makefile
--- a/mail/cyrus-imapd/Makefile Mon Oct 09 12:25:44 2006 +0000
+++ b/mail/cyrus-imapd/Makefile Mon Oct 09 12:46:01 2006 +0000
@@ -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 -r 87a6f4be18ec -r cc176d023d0a mail/cyrus-imapd/distinfo
--- a/mail/cyrus-imapd/distinfo Mon Oct 09 12:25:44 2006 +0000
+++ b/mail/cyrus-imapd/distinfo Mon Oct 09 12:46:01 2006 +0000
@@ -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-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 -r 87a6f4be18ec -r cc176d023d0a mail/cyrus-imapd/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/cyrus-imapd/patches/patch-ae Mon Oct 09 12:46:01 2006 +0000
@@ -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;
+ }



Home | Main Index | Thread Index | Old Index