mirage / ocaml-tar

Pure OCaml library to read and write tar files
ISC License
54 stars 34 forks source link

Meaning of `level` when reading #125

Closed reynir closed 9 months ago

reynir commented 1 year ago

To me the meaning of the compatibility level argument when reading is unclear. It seems to only affect how the link indicator is deserialized: https://github.com/mirage/ocaml-tar/blob/fa05f168a83ddcd8906bb068e3b2f64388ddc95c/lib/tar.ml#L280-L293

A few lines above that function a comment says V7 strictly speaking only supports Normal and Hard only. https://github.com/mirage/ocaml-tar/blob/fa05f168a83ddcd8906bb068e3b2f64388ddc95c/lib/tar.ml#L266-L267

To me, it seems that at least V7 and Ustar should not support GlobalExtendedHeader or PerFileExtendedHeader as they require Posix.

Since the reader is not very good at enforcing the compatibility level when reading perhaps this option should just be removed?

reynir commented 1 year ago

I discovered it is also used when deciding how to deal with link indicator types K and L (LongName and LongLink).

hannesm commented 9 months ago

This has been removed in #127