diff options
author | Mark Johnston <markj@FreeBSD.org> | 2021-01-03 16:32:30 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2021-01-03 16:50:31 +0000 |
commit | 90f580b954090e669da234f6c8e8d0379ff9d8bc (patch) | |
tree | ce741a3e6557b95df9e5c1d99a6a85598b75ac95 /sys/fs/autofs | |
parent | 663de81f852fccc38006b0172f9337147b65890f (diff) | |
download | src-90f580b954090e669da234f6c8e8d0379ff9d8bc.tar.gz src-90f580b954090e669da234f6c8e8d0379ff9d8bc.zip |
Ensure that dirent's d_off field is initialized
We have the d_off field in struct dirent for providing the seek offset
of the next directory entry. Several filesystems were not initializing
the field, which ends up being copied out to userland.
Reported by: Syed Faraz Abrar <faraz@elttam.com>
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27792
Diffstat (limited to 'sys/fs/autofs')
-rw-r--r-- | sys/fs/autofs/autofs_vnops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c index a6ae0b440c4a..13daa950d75b 100644 --- a/sys/fs/autofs/autofs_vnops.c +++ b/sys/fs/autofs/autofs_vnops.c @@ -367,6 +367,7 @@ autofs_readdir_one(struct uio *uio, const char *name, int fileno, return (EINVAL); dirent.d_fileno = fileno; + dirent.d_off = uio->uio_offset + reclen; dirent.d_reclen = reclen; dirent.d_type = DT_DIR; dirent.d_namlen = namlen; |