From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A6D313973122; Tue, 3 Nov 2020 09:34:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6D313973122 From: "stsp at users dot sourceforge.net" To: glibc-bugs@sourceware.org Subject: [Bug libc/10353] Methods for deleting all file descriptors greater than given integer (closefrom) Date: Tue, 03 Nov 2020 09:34:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stsp at users dot sourceforge.net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 09:34:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D10353 Stas Sergeev changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stsp at users dot sourcefo= rge.net --- Comment #19 from Stas Sergeev --- Hi. What do you think about this closefrom() to only set FD_CLOEXEC rather than to do the actual close()? Seems more consistent to me. - compatible with popen(), posix_spawn(), system() and co as you can just do it before fork() - does exactly what we need, and in a less invasive way - don't we need to close files only at exec()? - clearly underlines the fact that O_CLOEXEC should have been on by default since the creation of posix, but its not. So it fixes exactly that rather than working around that by doing explicit close(). Just an idea. --=20 You are receiving this mail because: You are on the CC list for the bug.=