freebsd-dev/lib/libnv
Mark Johnston 991666adc7 Ensure that libnv can be used when kern.trap_enotcap=1.
libnv used fcntl(fd, F_GETFL) to test whether fd is a valid file
descriptor.  Aside from being racy, this check requires CAP_FCNTL
rights on fd.  Instead, use fcntl(fd, F_GETFD), which does not require
any capability rights.

Also remove some redundant fd_is_valid() checks to avoid extra system
calls; in many cases we were performing this check immediately before
dup()ing the descriptor.

Reviewed by:	cem, oshogbo (previous version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17963
2018-11-13 20:07:55 +00:00
..
tests Ensure that libnv can be used when kern.trap_enotcap=1. 2018-11-13 20:07:55 +00:00
common_impl.h Ensure that libnv can be used when kern.trap_enotcap=1. 2018-11-13 20:07:55 +00:00
Makefile libnv: Remove -I${SRCTOP}/sys 2018-08-09 20:29:44 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
msgio.c Ensure that libnv can be used when kern.trap_enotcap=1. 2018-11-13 20:07:55 +00:00
msgio.h lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00