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 |
||
---|---|---|
.. | ||
cnv_tests.cc | ||
dnv_tests.cc | ||
Makefile | ||
Makefile.depend | ||
nv_array_tests.cc | ||
nv_tests.cc | ||
nvlist_add_test.c | ||
nvlist_append_test.c | ||
nvlist_exists_test.c | ||
nvlist_free_test.c | ||
nvlist_get_test.c | ||
nvlist_move_test.c | ||
nvlist_send_recv_test.c |