From 31d327c3780aecdb78304263f676ff89a8ea93d1 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 1 May 2019 16:55:08 +0200 Subject: unsquashfs: read ID table from file Signed-off-by: David Oberhollenzer --- unpack/unsquashfs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'unpack') diff --git a/unpack/unsquashfs.c b/unpack/unsquashfs.c index 4606366..f5c3a43 100644 --- a/unpack/unsquashfs.c +++ b/unpack/unsquashfs.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ #include "squashfs.h" #include "compress.h" +#include "id_table.h" #include #include @@ -14,6 +15,7 @@ int main(int argc, char **argv) int fd, status = EXIT_FAILURE; sqfs_super_t super; compressor_t *cmp; + id_table_t idtbl; if (argc != 2) { fprintf(stderr, "Usage: %s \n", __progname); @@ -56,8 +58,16 @@ int main(int argc, char **argv) if (cmp == NULL) goto out; - status = EXIT_SUCCESS; + if (id_table_init(&idtbl)) + goto out_cmp; + + if (id_table_read(&idtbl, fd, &super, cmp)) + goto out_idtbl; + status = EXIT_SUCCESS; +out_idtbl: + id_table_cleanup(&idtbl); +out_cmp: cmp->destroy(cmp); out: close(fd); -- cgit v1.2.3