summaryrefslogtreecommitdiff
path: root/src/pdf_view.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-28 21:54:47 -0300
committerGabriel Schneider <[email protected]>2026-10-28 21:54:47 -0300
commit30b7fd64b4b819abafd293f4ef45bf8ece3082e2 (patch)
tree21646492843985edecd18170816cf73dd698aba3 /src/pdf_view.zig
parent3ad8a8117435124d5df8c1d70de62c32dd97e113 (diff)
downloadpardes-30b7fd64b4b819abafd293f4ef45bf8ece3082e2.tar.gz
pardes-30b7fd64b4b819abafd293f4ef45bf8ece3082e2.zip
kitty media: a FIFO, device or huge file named by t=f, t=t or t=s no longer hangs pardes or swells it (ghostty's loader patched at build time)
A program in a pane that named a FIFO (`mkfifo /tmp/f`, then t=f, t=t, or t=s through /dev/shm) hung the whole editor: ghostty's loader opens the path and only then checks that it is a regular file, and an open for reading waits for a writer. A device was opened too before being refused (an open may do something), and any image file up to ghostty's 400 MB was read and held before a screen's 64 MiB storage could refuse it. build.zig's patchGhosttyKitty patches src/terminal/kitty/graphics_image.zig with count-checked anchors, as vaxis and mvzr are: on Linux a path is probed with O_PATH (which opens nothing), must be a regular file, and that same inode is reopened through /proc/self/fd; shared memory must be a regular file (stat of /dev/shm/<name> first, then shm_open non-blocking and fstat); max_size is TerminalImages.storage_limit. Which paths are accepted stays ghostty's (kitty's) policy, which the user accepts. Tests: a FIFO by each medium and through a /dev/shm symlink does not block (a watchdog thread opens it for writing after 1.5 s and the test fails if it had to); /proc, /sys, devices and directories are refused; t=t leaves a tty-graphics-protocol file outside the temp directory, and one behind a /tmp symlink; a 100 MiB file is refused. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pdf_view.zig')
0 files changed, 0 insertions, 0 deletions