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
Unknown Object (File)
Tue, Apr 16, 2:36 PM
Unknown Object (File)
Tue, Apr 16, 3:11 AM
Unknown Object (File)
Thu, Apr 11, 7:16 PM
Unknown Object (File)
Thu, Apr 11, 5:34 PM
Unknown Object (File)
Dec 22 2023, 4:36 AM
Unknown Object (File)
Dec 20 2023, 6:34 AM
Unknown Object (File)
Dec 11 2023, 2:54 PM
Unknown Object (File)
Dec 5 2023, 5:06 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable