Bug 802027

Summary: [RFE] Add option -D_FORCE_OCLOEXEC
Product: [Fedora] Fedora Reporter: Daniel Walsh <dwalsh>
Component: glibcAssignee: Jeff Law <law>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: calimocho.fedora, fweimer, jakub, law, mnewsome, pfrankli, schwab
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-08 20:33:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.