Bug 802027 - [RFE] Add option -D_FORCE_OCLOEXEC
Summary: [RFE] Add option -D_FORCE_OCLOEXEC
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-10 11:11 UTC by Daniel Walsh
Modified: 2016-11-24 16:02 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-08 20:33:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Walsh 2012-03-10 11:11:19 UTC
In my blog 
http://danwalsh.livejournal.com/53603.html

I was complaining about leaking file descriptors.

One of the comments suggests:
 
"Most current software actually need O_CLOEXEC as default behaviour, unfortunately there is no "magic" -D_FORCE_OCLOEXEC ( like FORTIFY_SOURCE) or a compiler flag -fcloexec .. that would make the task for distributions so much easier..."

What do you think?  

Or at least an option where leaking FD > 2 (STDERR) would be blocked.

Comment 1 David Martinez 2012-06-08 15:44:36 UTC
Daniel, after reading your blog post I changed the component from glibc to gcc (I think this was your original intention).

A philosophical question: isn't the "right" thing to do to modify calls to open(), etc in source to include the correct flags instead of forcing it on the backend?  Could this new feature have negative implications in other scenarios? (asking out of ignorance)

Comment 2 Jakub Jelinek 2012-06-08 15:53:27 UTC
Please don't change the component, gcc really has nothing to do with that.

Comment 3 Jeff Law 2012-06-08 20:33:34 UTC
I don't think changing the default behavior like this is a wise idea.  Folks that want this behaviour relaly need to ask for it explicitly.


Note You need to log in before you can comment on or make changes to this bug.