53353090d0
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