search for: calculate_offset_of_entry

Displaying 3 results from an estimated 3 matches for "calculate_offset_of_entry".

2020 Jul 07
3
[PATCH nbdkit] tar as a filter.
For review only, this needs some clean up and more tests. My eyes are going cross-eyed looking at the calculate_offset_of_entry function, so time to take a break ... Rich.
2020 Jul 07
0
[PATCH nbdkit] New filter: tar.
...urn h; +} + +static void +tar_close (void *handle) +{ + free (handle); +} + +/* Calculate the offset of the entry within the tarball. This is + * called with the lock held. The method used is described here: + * https://www.redhat.com/archives/libguestfs/2020-July/msg00017.html + */ +static int +calculate_offset_of_entry (struct nbdkit_next_ops *next_ops, void *nxdata) +{ + const size_t bufsize = 65536; + char output[] = "/tmp/tarXXXXXX"; + int fd; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + size_t cmdlen = 0; + CLEANUP_FREE char *buf = NULL; + int64_t i, copysize; + bool scanned_ok = false; +...
2023 Jun 13
3
[PATCH nbdkit 0/3] tar: Implement tar-limit
This patch series cleans up some issues with nbdkit-tar-filter and (in patch 3) implements a new tar-limit feature which limits how much of the tar file we will read to find the entry within the tar file that we will serve. This protects against the case where a tar file is presented that contains much content at the front that we must iterate over (and download) before we get to the entry we are