mirror of
https://github.com/fscotto/fsnap.git
synced 2026-11-26 03:09:51 +00:00
e2b45e6left symlinks with fingerprint 0 on the grounds that the target field already describes them. Restore a real checksum for them, computed over the target string readlink reports -- which is what the link actually holds on disk -- rather than over the referent's contents, which is what the code did beforee2b45e6and what made `create /etc` fail with EISDIR on the 13 links there that point at directories. Adds crc32_buffer for the in-memory case. Values agree with zlib.crc32 of the same string. Directories keep 0, and so do FIFOs, sockets and devices: those cannot be read at all rather than merely being awkward to read. A FIFO blocks until a writer appears, which is an indefinite hang, not an error. Also reorder RecordObjectCompare to test target before fingerprint. Since a link's fingerprint is now a function of its target, the old order reported a changed target as a changed checksum, and diff printed M where it should print L. The fields are now compared in the order the record stores them. Verified: all 1236 symlinks in a tree shaped like /etc get a non-zero fingerprint and the walk completes; L, M and P classifications confirmed individually; valgrind clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx
729 B
729 B