bugGNU Mailutils - Bugs: bug #27331, file descriptor leak related to...

 
 

bug #27331: file descriptor leak related to tls_stream_create (patch included)

Submitted by:  Kevin Hildebrand <ke3vin>
Submitted on:  Thu 27 Aug 2009 11:18:12 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Sergey Poznyakoff <gray>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 09 Feb 2010 02:31:53 PM UTC, comment #1:

This required a bit more work. It is fixed now (commit 2235ee27). Thank you.

Sergey Poznyakoff <gray>
Project AdministratorIn charge of this item.
Thu 27 Aug 2009 11:18:12 AM UTC, original submission:

The problem:
Functions (such as pop_open in libproto/pop/mbox.c) call mu_tls_stream_create which allocates a new stream. These functions then replace their current stream object with the new one. This means that when the calling function gets around to closing its stream, the _close methods in the original stream
object don't get called. This ends up leaking file descriptors.

My solution is to have _tls_close call mu_stream_close on the stored input and output streams. However, this may not be the ideal fix, as technically closing the tls stream shouldn't necessarily close the underlying streams.
The proper fix might be to modify the calling functions to save their original stream pointer and have them call mu_stream_close.

Anyway, my simple patch is attached.

Kevin

Kevin Hildebrand <ke3vin>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #18648:  tlspatch added by ke3vin (262B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gray (Posted a comment)
  • -unavailable- added by ke3vin (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 09 Feb 2010 02:31:53 PM UTCgrayAssigned toNone=>gray
      Open/ClosedOpen=>Closed
    Tue 09 Feb 2010 02:31:52 PM UTCgrayStatusNone=>Fixed
    Thu 27 Aug 2009 11:18:12 AM UTCke3vinAttached File-=>Added tlspatch, #18648

    Back to the top


    Powered by Savane 3.1-cleanup1