summaryrefslogtreecommitdiff
path: root/test/integration/test-close-range
Commit message (Collapse)AuthorAgeFilesLines
* ExecFork: Simplify closing and make it safeJulian Andres Klode2025-10-201-32/+0
| | | | | | | | | Implement a wrapper around FD_CLOEXEC and use it in place of the raw fcntl(). This wrapper _Exit()s the child if the operation failed. Restructure the close_range() handling to simply mark all fds for closing first and then "reopen" the ones we should keep.
* Add some comments and tests around Keep-Fd orderingJulian Andres Klode2025-10-201-0/+7
|
* ExecFork: Use close_range() if availableJulian Andres Klode2025-10-201-0/+25
Use close_range() if we have it in preference to iterating over /proc/self/fd and falling back to closing all possible fds. This builds sets of ranges to close that take into account the APT::Keep-Fds vector, and a test case is provided to ensure correctness of the splitting logic. Preference is given to close_range() over /proc as in the optimal case, this results in a single system call!