freebsd-skq/usr.bin/cmp
Mark Johnston 2528b7e2cb 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
2019-02-25 19:47:27 +00:00
..
tests Fix handling of rights on stdio streams, take two. 2019-02-25 19:47:27 +00:00
cmp.1 cmp(1): Provide some long options 2018-05-02 01:32:34 +00:00
cmp.c Fix handling of rights on stdio streams, take two. 2019-02-25 19:47:27 +00:00
extern.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
link.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
Makefile Add HAS_TESTS to all Makefiles that are currently using the 2017-08-02 08:50:42 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
misc.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
regular.c Fix handling of rights on stdio streams, take two. 2019-02-25 19:47:27 +00:00
special.c Fix handling of rights on stdio streams, take two. 2019-02-25 19:47:27 +00:00