]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix handling of rights on stdio streams, take two.
authormarkj <markj@FreeBSD.org>
Mon, 25 Feb 2019 19:47:27 +0000 (19:47 +0000)
committermarkj <markj@FreeBSD.org>
Mon, 25 Feb 2019 19:47:27 +0000 (19:47 +0000)
commit53353090d004f1a8a1297ece323f669f50042621
tree5e40d9b51896c66d3503244bb491a37152f8f474
parent435f0b6365c79e4721e894df7033cb7de50662be
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
usr.bin/cmp/cmp.c
usr.bin/cmp/regular.c
usr.bin/cmp/special.c
usr.bin/cmp/tests/cmp_test2.sh