Page MenuHomeFreeBSD

Fix the case where stdin is closed, second attempt.
ClosedPublic

Authored by markj on Feb 16 2019, 8:51 PM.
Tags
None
Referenced Files
F106653416: D19216.diff
Fri, Jan 3, 10:39 AM
Unknown Object (File)
Thu, Dec 26, 5:59 PM
Unknown Object (File)
Wed, Dec 25, 5:56 PM
Unknown Object (File)
Wed, Dec 25, 4:25 AM
Unknown Object (File)
Sun, Dec 22, 6:37 AM
Unknown Object (File)
Nov 27 2024, 12:30 AM
Unknown Object (File)
Nov 19 2024, 9:19 AM
Unknown Object (File)
Oct 13 2024, 8:10 AM
Subscribers

Details

Summary

We have to be careful with caph_limit_stdio(): we cannot use it if one
of the input files is stdin, and we cannot use it after opening the
input files, since if one of the standard descriptors is closed it may
be reused for one of the input files.

Rather than partially duplicating caph_limit_stream() in main(), limit
rights in c_regular() and c_special(). Don't register a SIGSEGV handler
until we're committed to using mmap().

Add a regression test.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22534
Build 21676: arc lint + arc unit