From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 411163982ED0; Tue, 3 Nov 2020 09:45:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 411163982ED0 From: "fweimer at redhat dot com" 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:45:44 +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: fweimer at redhat dot com 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: 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:45:45 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D10353 --- Comment #20 from Florian Weimer --- (In reply to Stas Sergeev from comment #19) > 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()? You can't set CLOEXEC safely before the fork, it would have to come after.= =20 There isn't much difference between closing and setting the flag directly. --=20 You are receiving this mail because: You are on the CC list for the bug.=