const void **, size_t *, int64_t *);
static int archive_read_format_cpio_read_header(struct archive_read *,
struct archive_entry *);
+static int archive_read_format_cpio_skip(struct archive_read *);
static int be4(const unsigned char *);
static int find_odc_header(struct archive_read *);
static int find_newc_header(struct archive_read *);
NULL,
archive_read_format_cpio_read_header,
archive_read_format_cpio_read_data,
- NULL,
+ archive_read_format_cpio_skip,
archive_read_format_cpio_cleanup);
if (r != ARCHIVE_OK)
}
}
+static int
+archive_read_format_cpio_skip(struct archive_read *a)
+{
+ struct cpio *cpio = (struct cpio *)(a->format->data);
+ int64_t to_skip = cpio->entry_bytes_remaining + cpio->entry_padding +
+ cpio->entry_bytes_unconsumed;
+
+ if (to_skip != __archive_read_consume(a, to_skip)) {
+ return (ARCHIVE_FATAL);
+ }
+ cpio->entry_bytes_remaining = 0;
+ cpio->entry_padding = 0;
+ cpio->entry_bytes_unconsumed = 0;
+ return (ARCHIVE_OK);
+}
+
/*
* Skip forward to the next cpio newc header by searching for the
* 07070[12] string. This should be generalized and merged with