Repository navigation
fix(plugin): support long inventory output filenames - #1214
Conversation
The inventory writer named its temporary file after the output, so a valid output name near the 255-byte filename limit overflowed once the prefix, random part, and suffix were added, and the update failed with ENAMETOOLONG.
mldangelo-oai
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. I reproduced the failure on Linux using the actual inventory CLI: a valid 242-byte destination name fails with ENAMETOOLONG before this change. With the patch, both repository and diff inventories succeed with filenames up to 255 bytes, including multibyte names, for new files and replacements.
The shorter prefix preserves same-directory atomic replacement, exclusive temporary-file creation, and cleanup. I found no consumers relying on the old temporary naming scheme. The normal scan path uses a short fixed filename, so this is a useful edge-case fix for custom output paths, with no added API or complexity.
All 78 inventory tests and all five portable source checks passed. Concurrent-write checks also passed with correct contents and no leftover temporary files. Looks good to me.
Summary
write_inventory()names its temp file.{output.name}.<random>.tmp, so a long output name pushes the temp name past the 255-byte limit and the write fails withENAMETOOLONG.Changes
Use a fixed
.prefix for the temp file. Added a regression test with long ASCII and UTF-8 names.Testing
Tests pass.
Risk and rollout
Only the temp file name changes.
Public disclosure review