From 29345117a4cf85aceb88e3901758b19a4867062e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 19 Apr 2024 00:12:50 -0700 Subject: [PATCH] Fix bug with stat truncating pipe/socket st_ino Problem reported by Sergei Trofimovich in: https://bugs.gnu.org/70411 https://github.com/NixOS/nixpkgs/pull/300797 * bsd/miscfs/devfs/devfs_fdesc_support.c (fdesc_attr): Do not truncate inode numbers to 32 bits. --- bsd/miscfs/devfs/devfs_fdesc_support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd/miscfs/devfs/devfs_fdesc_support.c b/bsd/miscfs/devfs/devfs_fdesc_support.c index a17c6992..b4a55103 100644 --- a/bsd/miscfs/devfs/devfs_fdesc_support.c +++ b/bsd/miscfs/devfs/devfs_fdesc_support.c @@ -437,10 +437,10 @@ fdesc_attr(int fd, struct vnode_attr *vap, vfs_context_t a_context) case DTYPE_PIPE: #if SOCKETS if (FILEGLOB_DTYPE(fp->fp_glob) == DTYPE_SOCKET) { - error = soo_stat((struct socket *)fp_get_data(fp), (void *)&stb, 0); + error = soo_stat((struct socket *)fp_get_data(fp), (void *)&stb, 1); } else #endif /* SOCKETS */ - error = pipe_stat((struct pipe *)fp_get_data(fp), (void *)&stb, 0); + error = pipe_stat((struct pipe *)fp_get_data(fp), (void *)&stb, 1); if (error == 0) { if (FILEGLOB_DTYPE(fp->fp_glob) == DTYPE_SOCKET) { -- 2.44.0