git: 5fb54d2fc845 - main - readlinkat(2): allow O_PATH fd
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Oct 2021 19:32:05 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=5fb54d2fc845464ea809e6a1a69380693943cf51
commit 5fb54d2fc845464ea809e6a1a69380693943cf51
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-10-09 05:12:05 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-10-09 19:31:37 +0000
readlinkat(2): allow O_PATH fd
PR: 258856
Reported by: ashish
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32390
---
lib/libc/sys/open.2 | 5 +++--
sys/kern/vfs_syscalls.c | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index 5a6f161291f6..da42c238a151 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -28,7 +28,7 @@
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\" $FreeBSD$
.\"
-.Dd May 6, 2021
+.Dd October 9, 2021
.Dt OPEN 2
.Os
.Sh NAME
@@ -327,7 +327,7 @@ and others.
The other functionality of the returned file descriptor is limited to
the descriptor-level operations.
It can be used for
-.Bl -tag -width SCM_RIGHTS -offset indent -compact
+.Bl -tag -width readlinkat(2) -offset indent -compact
.It Xr fcntl 2
but advisory locking is not allowed
.It Xr dup 2
@@ -346,6 +346,7 @@ message
.It Xr kqueue 2
using for
.Dv EVFILT_VNODE
+.It Xr readlinkat 2
.El
But operations like
.Xr read 2 ,
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index bd496db50e99..1b355eea7d6a 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2640,8 +2640,8 @@ kern_readlinkat(struct thread *td, int fd, const char *path,
if (count > IOSIZE_MAX)
return (EINVAL);
- NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1,
- pathseg, path, fd, td);
+ NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 |
+ EMPTYPATH, pathseg, path, fd, td);
if ((error = namei(&nd)) != 0)
return (error);