zlib: do not hang archiving a FIFO or device · nodejs/node@2bda6db · GitHub
Skip to content

Commit 2bda6db

Browse files
pipobscureaduh95
authored andcommitted
zlib: do not hang archiving a FIFO or device
zipFiles() opened each source before fstat-ing it, so open() on a FIFO (or a slow/blocking device) blocked indefinitely - the regular-file guard ran too late to prevent it, and each stuck open pinned a libuv threadpool thread. Open with O_NONBLOCK so the open returns promptly and the fstat can reject anything that is not a regular file; O_NONBLOCK has no effect on a regular file's subsequent reads. Signed-off-by: Philipp Dunkel <pip@pipobscure.com> PR-URL: #65016 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 55b0495 commit 2bda6db

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/internal/zip/archive.js

Lines changed: 7 additions & 4 deletions

0 commit comments

Comments
 (0)