Skip to content

cpio mode enhancements#259

Open
mcandre wants to merge 2 commits intoindygreg:mainfrom
mcandre:cpio-metadata
Open

cpio mode enhancements#259
mcandre wants to merge 2 commits intoindygreg:mainfrom
mcandre:cpio-metadata

Conversation

@mcandre
Copy link

@mcandre mcandre commented Jan 23, 2026

  • Tweak API to distinguish between preserving the mode seen on disk, vs. overriding file/directory modes.
  • Prototype a helper function permissions_to_u32, as a best effort disk mode loader that compiles for UNIX and nonUNIX targets. I've been copying this logic among a variety of my personal Rust projects. Invited to analyze, just in case I got something wrong there.
  • Remove complicated logic concerning executables. A passthrough design is safer, and respects the user's intent. If more advanced logic is needed, consider something resembling chandler, which uses fast, filename based logic instead of waiting to read mimetype data. https://github.com/mcandre/chandler It simply assumes that (.exe files + extensionless files) are executables, and nothing else, unless the user explicitly configures the archival settings otherwise. A modest collection of exceptions are included by default, such as makefile, LICENSE, README, etc.
  • Fix ambiguous mode emitted by append_file_from_path.
  • Update Cargo.lock (recommend redoing with cargo update by the author as a security precaution).

is_detection is interesting. I wouldn't mind that logic as much, if the cpio builder gained an option to disable it.

Unit tests pass regardless of this change. Recommend introducing additional tests.

Relates to #255

@mcandre mcandre changed the title isolate configuration between preserving vs overriding modes cpio mode enhancements Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant