Skip to main content

Module fd

Module fd 

Source
Expand description

File-descriptor evidence: where the player’s command sent stdout and stderr.

Section 10 teaches redirection, so the game must see what ./buggy.sh &> /dev/null did to the script’s output. The shell runs a tiny hook inside the redirected command, and the hook looks at its own file descriptors 1 and 2. Comparing device and inode numbers with those of /dev/null needs no /proc, so it works on macOS too.

Structs§

FdTarget
Identity of whatever a file descriptor points at.
Fds
Where stdout and stderr of the hooked command point.