commit-mailutils
[Top][All Lists]
Advanced

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

[SCM] GNU Mailutils branch, master, updated. rel-2_1-34-g2235ee2


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. rel-2_1-34-g2235ee2
Date: Tue, 09 Feb 2010 14:30:30 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=2235ee278c7b50002ba54e0f1e5ae5ef143f5629

The branch, master has been updated
       via  2235ee278c7b50002ba54e0f1e5ae5ef143f5629 (commit)
       via  7cdb5991a67eb355434b2457abcd3b931b6602de (commit)
      from  5f97b64945c9be3f50ca7ffc664ff87a08bd7a9b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2235ee278c7b50002ba54e0f1e5ae5ef143f5629
Author: Sergey Poznyakoff <address@hidden>
Date:   Tue Feb 9 16:30:01 2010 +0200

    Fix TLS stream leak.
    
    * libmu_auth/tls.c (_tls_destroy): Destroy underlying streams,
    unless MU_STREAM_NO_CLOSE is set.
    (_tls_close): Likewise for close.

commit 7cdb5991a67eb355434b2457abcd3b931b6602de
Author: Sergey Poznyakoff <address@hidden>
Date:   Tue Feb 9 16:04:43 2010 +0200

    Bugfixes.
    
    * libproto/imap/mbox.c (imap_append_message0): Send trailing CRLF,
    not just LF.
    * mailbox/cfg_parser.y (mu_cfg_parse): Zero out _mu_cfg_debug
    to avoid destroying it doubly.
    * mailbox/mbx_default.c (plus_expand): Remove unused variable.

-----------------------------------------------------------------------

Summary of changes:
 libmu_auth/tls.c      |   25 +++++++++++++++++++++++--
 libproto/imap/mbox.c  |    4 ++--
 mailbox/cfg_parser.y  |    1 +
 mailbox/mbx_default.c |    2 +-
 4 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/libmu_auth/tls.c b/libmu_auth/tls.c
index 7a4970d..9d28f9e 100644
--- a/libmu_auth/tls.c
+++ b/libmu_auth/tls.c
@@ -258,6 +258,8 @@ static void
 _tls_destroy (mu_stream_t stream)
 {
   struct _tls_stream *s = mu_stream_get_owner (stream);
+  int flags;
+  
   if (x509_cred)
     gnutls_certificate_free_credentials (x509_cred);
   if (s->session && s->state == state_closed)
@@ -266,6 +268,15 @@ _tls_destroy (mu_stream_t stream)
       s->state = state_destroyed;
     }
   _auth_lb_destroy (&s->lb);
+
+  mu_stream_get_flags (stream, &flags);
+  if (!(flags & MU_STREAM_NO_CLOSE))
+    {
+      int same_stream = s->strin == s->strout;
+      mu_stream_destroy (&s->strin, mu_stream_get_owner (s->strin));
+      if (!same_stream)
+       mu_stream_destroy (&s->strout, mu_stream_get_owner (s->strout));
+    }
   free (s);
 }
     
@@ -371,11 +382,21 @@ static int
 _tls_close (mu_stream_t stream)
 {
   struct _tls_stream *s = mu_stream_get_owner (stream);
+  int flags;
+  
   if (s->session && s->state == state_open)
     {
       gnutls_bye (s->session, GNUTLS_SHUT_RDWR);
       s->state = state_closed;
     }
+  
+  mu_stream_get_flags (stream, &flags);
+  if (!(flags & MU_STREAM_NO_CLOSE))
+    {
+      mu_stream_close (s->strin);
+      if (s->strin != s->strout)
+       mu_stream_close (s->strout);
+    }
   return 0;
 }
 
@@ -578,7 +599,7 @@ _tls_wait (mu_stream_t stream, int *pflags, struct timeval 
*tvp)
    mu_tls_stream_create_client will malfunction */
 int
 mu_tls_stream_create (mu_stream_t *stream,
-                  mu_stream_t strin, mu_stream_t strout, int flags)
+                     mu_stream_t strin, mu_stream_t strout, int flags)
 {
   struct _tls_stream *s;
   int rc;
@@ -618,7 +639,7 @@ mu_tls_stream_create (mu_stream_t *stream,
 
 int
 mu_tls_stream_create_client (mu_stream_t *stream,
-                         mu_stream_t strin, mu_stream_t strout, int flags)
+                            mu_stream_t strin, mu_stream_t strout, int flags)
 {
   struct _tls_stream *s;
   int rc;
diff --git a/libproto/imap/mbox.c b/libproto/imap/mbox.c
index d31957a..3bf1d1b 100644
--- a/libproto/imap/mbox.c
+++ b/libproto/imap/mbox.c
@@ -1081,8 +1081,8 @@ imap_append_message0 (mu_mailbox_t mailbox, mu_message_t 
msg)
          }
        f_imap->state = IMAP_APPEND_ACK;
       }
-      /* address@hidden UW-IMAP server hack: insists on the last line.  */
-      imap_writeline (f_imap, "\n");
+      /* address@hidden UW-IMAP and Gimap server hack: both insist on the last 
line.  */
+      imap_writeline (f_imap, "\r\n");
       status = imap_send (f_imap);
       CHECK_EAGAIN (f_imap, status);
 
diff --git a/mailbox/cfg_parser.y b/mailbox/cfg_parser.y
index a8bd044..f938526 100644
--- a/mailbox/cfg_parser.y
+++ b/mailbox/cfg_parser.y
@@ -442,6 +442,7 @@ mu_cfg_parse (mu_cfg_tree_t **ptree)
 
   tree = mu_alloc (sizeof (*tree));
   tree->debug = _mu_cfg_debug;
+  _mu_cfg_debug = NULL;
   tree->head = parse_head;
   tree->tail = parse_tail;
   tree->pool = mu_cfg_lexer_pool ();
diff --git a/mailbox/mbx_default.c b/mailbox/mbx_default.c
index e135a82..e970d15 100644
--- a/mailbox/mbx_default.c
+++ b/mailbox/mbx_default.c
@@ -270,7 +270,7 @@ plus_expand (const char *file, char **buf)
 {
   char *home;
   const char *folder_dir = mu_folder_directory ();
-  int status, len;
+  int len;
 
   home = get_homedir (NULL);
   if (!home)


hooks/post-receive
-- 
GNU Mailutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]