HomeFreeBSD

Fix handling of rights on stdio streams, take two.

Description

Fix handling of rights on stdio streams, take two.

Split the rights-limiting code into two cases: if one of the input
files isn't a regular file, use caph_limit_stream(3) instead of
open-coding the same logic; if both input files are regular files,
and the initial attempts to map them succeed, we limit the rights on
those files to CAP_MMAP_R.

Add a regression test for PR 234885.

PR: 234885
Reviewed by: delphij
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19216

Details

Provenance
markjAuthored on
Reviewer
delphij
Differential Revision
D19216: Fix the case where stdin is closed, second attempt.
Parents
rS344550: Improve vmem tuning for platforms without a direct map.
Branches
Unknown
Tags
Unknown