mirage / ocaml-tar

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

Mirage: Include padding when computing end_bytes #104

Closed reynir closed 1 year ago

reynir commented 1 year ago

Otherwise we may not zero the last (padding-length) bytes in the sentinel - and if there's already garbage on the block device at that location the tar filesystem potentially breaks.

This has not been a problem so far as the block devices are usually zeroed outside the data.

hannesm commented 1 year ago

I'm not sure I understand... the space_needed is the data with padding (to tar block size, 512 byte). Which other padding may occur?

reynir commented 1 year ago

Ah, indeed. Nevermind then.