Skip to content

read_file: reject non-regular files (FIFO hang inside the jail) #117

Closed

Description

@ajianaz

read_file can hang forever on a FIFO/named pipe inside the workspace jail (cora full-scan MAJOR #21): only directories are rejected; a FIFO passes, metadata().len() is 0 so the 1 MiB cap never triggers, and the open/read blocks indefinitely.

Fix: require meta.is_file() (covers FIFOs/sockets/devices) and enforce the size cap at read time, not metadata time.

Acceptance: unit test creating a FIFO in the jail (mkfifo) and asserting a clean error, not a hang (run under a timeout in the test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions