Bug 8171

Summary: Plug file descriptor leak + handle EINTR in close()s
Product: dbus Reporter: Kimmo Hämäläinen <kimmo.hamalainen>
Component: coreAssignee: Havoc Pennington <hp>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: normal    
Priority: high Keywords: patch
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch
another patch for missing fclose()
plug another FD leak in dbus-spawn.c

Description Kimmo Hämäläinen 2006-09-07 06:50:54 UTC
We found a file descriptor leak (no close-on-exec set) from D-Bus.
I also noticed that many places in the code uses close() instead of
_dbus_close() -- that's bad because then EINTR is not handled.

Attaching the patch.

Note: I made the patch originally for 0.62, so it might miss something in the
trunk version.
Comment 1 Kimmo Hämäläinen 2006-09-07 06:51:51 UTC
Created attachment 6865 [details] [review]
proposed patch
Comment 2 Kimmo Hämäläinen 2006-09-07 08:15:47 UTC
Created attachment 6866 [details] [review]
another patch for missing fclose()

here is another patch for missing fclose(), although it does not have
consequences.
Comment 3 Kimmo Hämäläinen 2006-09-07 08:46:01 UTC
Created attachment 6867 [details] [review]
plug another FD leak in dbus-spawn.c

Ok, here is the last FD leak plugged. Now activated services don't inherit
leaked FDs.
Comment 4 John (J5) Palmieri 2006-09-07 11:29:34 UTC
Committed patches 1 and 3.  Patch 2 no longer applies because of the sysdep
split for unix and windows.  Can you regenerate the patch with the
--show-c-function flag.  Thanks.
Comment 5 Kimmo Hämäläinen 2006-09-08 00:12:41 UTC
(In reply to comment #4)
> Committed patches 1 and 3.  Patch 2 no longer applies because of the sysdep
> split for unix and windows.  Can you regenerate the patch with the
> --show-c-function flag.  Thanks.

Is there a tarball available for the trunk? (I have problem with CVS because of
the company firewall...)
Comment 6 John (J5) Palmieri 2006-09-08 07:44:12 UTC
If I just know what the methods are you are changing I can manually apply the patch.
Comment 7 John (J5) Palmieri 2006-09-13 22:20:42 UTC
Found the function. Closing

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.