Commits on Source 1

  • cznic's avatar
    modernc.org/libc: fix readdir returning deleted entries on openbsd · 342f5ac3
    cznic authored
    getdirentries(2) reports records of deleted files with d_fileno set to zero
    and readdir(3) must not return them. On FFS such a record survives an unlink
    whenever it is the first one in a directory block, so any directory larger
    than a single 512-byte block reported ghost entries for files that were
    already gone.
    
    That made Tcl's glob (via libtcl8.6) see deleted files, causing the
    modernc.org/libsqlite3 openbsd/amd64 test failures delete_db-1.3.1,
    delete_db-1.4.1, multiplex-2.4.5, multiplex-5.3.prep and quota-5.3.prep.
    The failures only showed up in full-suite runs, once the shared working
    directory had grown past one block.
    
    Also stop iterating on a malformed d_reclen rather than spinning on it,
    matching the checks in OpenBSD's _readdir_unlocked().
    
    Co-Authored-By: default avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
    342f5ac3
Loading
Loading