Summary: | close inherited filedescriptors | ||
---|---|---|---|
Product: | dbus | Reporter: | Colin Walters <walters> |
Component: | core | Assignee: | Havoc Pennington <hp> |
Status: | RESOLVED FIXED | QA Contact: | John (J5) Palmieri <johnp> |
Severity: | normal | ||
Priority: | medium | CC: | anssi, grahame, walters |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
don't inherit fds
don't inherit fds (removed if check) using posix sysconf(_SC_OPEN_MAX) instead getdtablesize |
Description
Colin Walters
2008-05-15 15:29:06 UTC
Created attachment 16558 [details] [review] don't inherit fds Created attachment 16559 [details] [review] don't inherit fds (removed if check) I was about to follow up on that =) Looks like a reasonable patch to me. Comment on attachment 16559 [details] [review] don't inherit fds (removed if check) This should look more like in glib/gspawn.c ; should use fdwalk() if available, and probably sysconf() or getrlimit() would be more modern than getdtablesize(). Can't just cut-and-paste glib code though, due to license. Maybe the author of that code would be willing to relicense, though it is not complex to reimplement. Created attachment 16665 [details] [review] using posix sysconf(_SC_OPEN_MAX) instead getdtablesize I had a quick look at how Python's subprocess module does it; it basically uses sysconf to get the max fds, and then calls a new function "os.closerange", which is just a basic loop doing close() over the fd range. fdwalk() seems like a Solaris-specific function? I would say let a patch for that be written/tested by someone from the OpenSolaris community if they want it. Stylistically this patch doesn't match the rest of the code - need a space between name and function call and the for loop. After that's fixed r=me. commit e2bc7232069b14b7299cb8b2eab436f60a232007 Author: Colin Walters <walters@verbum.org> Date: Wed May 28 16:01:22 2008 -0400 Bug 15947: Close file descriptors before execing helper (Markus Rechberger) * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Close file descriptors before exec. |
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.