Adjust unveil_find_cover() to return -1 if the root vnode is passed in.
authorclaudio <claudio@openbsd.org>
Tue, 29 Jun 2021 07:55:29 +0000 (07:55 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 29 Jun 2021 07:55:29 +0000 (07:55 +0000)
commit10478431668390c5c50729d40b7862f640658090
tree8522c8bdf814db202c62ee472cc573e3813b66a3
parentd0b698e17cb070a8f3e5081524f33169e71390a0
Adjust unveil_find_cover() to return -1 if the root vnode is passed in.
This helps unveil_add_vnode() to properly re-evaluate unveils when
"/" is added to the list.

Because of this adjust unveil_covered() to check for the root as well
so that in that case the unveil uv is returned instead of NULL. Traversing
up from the root returns the root. This check is not really needed since
namei has its own root check and shortcuts for root vnodes.

OK semarie@
sys/kern/kern_unveil.c