]> Sergey Matveev's repositories - public-inbox.git/commit
wwwstatic: avoid TOCTTOU for FIFO check
authorEric Wong <e@80x24.org>
Wed, 1 Jan 2020 10:38:58 +0000 (10:38 +0000)
committerEric Wong <e@80x24.org>
Wed, 1 Jan 2020 19:11:07 +0000 (19:11 +0000)
commit8c21d7dc061b5e53eb096f5e7edcb1cd16c0f959
tree21d53e5161667dd47ac2b9dcc000822ad3349061
parent7dddc72dd59b8947696cf0563034fda672b67905
wwwstatic: avoid TOCTTOU for FIFO check

We can use Perl's sysopen function to pass O_NONBLOCK to open(2)
and avoid blocking on FIFOs.  This avoids a TOCTTOU race where
somebody can change a regular to FIFO in between the stat(2) and
open(2) syscalls.
lib/PublicInbox/WwwStatic.pm