]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
O_PATH: Allow to open symlink
authorKonstantin Belousov <kib@FreeBSD.org>
Wed, 7 Apr 2021 03:23:25 +0000 (06:23 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Thu, 15 Apr 2021 09:49:09 +0000 (12:49 +0300)
commitf9b923af34a6749c7703b957742f33cc02a485a2
tree49e88d72ac53890dc375c49e2e8ebae5d7ef14ba
parenta5970a529c2d952714f20e4bc6e529c74fd2b3b5
O_PATH: Allow to open symlink

When O_NOFOLLOW is specified, namei() returns the symlink itself.  In
this case, open(O_PATH) should be allowed, to denote the location of symlink
itself.

Prevent O_EXEC in this case, execve(2) code is not ready to try to execute
symlinks.

Reported by: wulf
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323
sys/kern/vfs_vnops.c