cybernoid / archivemount

A fuse filesystem for mounting archives in formats supported by libarchive.
Other
184 stars 19 forks source link

cpio format archive is written back as tar format after modifying and unmounting #10

Closed ebertland closed 4 years ago

ebertland commented 4 years ago

In save(), the archive_format of oldarc is fetched before any calls to archive_read_next_header have been made. According to the libarchive documentation, the format is determined by reading the archive headers. As a result, the archive format is 0 and its string name is "(null)". When this format is used to set the newarc format, the code defaults to ustar. When one mounts a cpio or cpio.gz archive, modifies files, and unmounts it, archiveformat replaces the original cpio archive with a tar archive.