diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-03 23:33:41 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-03 23:33:41 +0200 |
commit | 6f7ee71165b30272a4f18bca361c324c7671680c (patch) | |
tree | 7f830e22992358f8a55082fad9e5890458af054a /unpack/unsquashfs.h | |
parent | 9de5c93986bc6a4b33f3f50ed2a94c9aa3a33c7f (diff) |
unsquashfs: add flags to filter what file types to unpack
This allows the user to skip stuff like device special files (which
non-root can't create anyway) or to not create symlinks/fifos etc...
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/unsquashfs.h')
-rw-r--r-- | unpack/unsquashfs.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/unpack/unsquashfs.h b/unpack/unsquashfs.h index 5895fb8..a8784fc 100644 --- a/unpack/unsquashfs.h +++ b/unpack/unsquashfs.h @@ -19,12 +19,23 @@ #include <fcntl.h> #include <stdio.h> +enum UNPACK_FLAGS { + UNPACK_NO_DEVICES = 0x01, + UNPACK_NO_SOCKETS = 0x02, + UNPACK_NO_FIFO = 0x04, + UNPACK_NO_SLINKS = 0x08, + UNPACK_NO_EMPTY = 0x10, + UNPACK_CHMOD = 0x20, + UNPACK_CHOWN = 0x40, +}; + tree_node_t *tree_node_from_inode(sqfs_inode_generic_t *inode, const id_table_t *idtbl, const char *name, size_t block_size); -int read_fstree(fstree_t *out, int fd, sqfs_super_t *super, compressor_t *cmp); +int read_fstree(fstree_t *out, int fd, sqfs_super_t *super, compressor_t *cmp, + int flags); void list_files(tree_node_t *node); @@ -32,6 +43,7 @@ int extract_file(file_info_t *fi, compressor_t *cmp, size_t block_size, frag_reader_t *frag, int sqfsfd, int outfd); int restore_fstree(const char *rootdir, tree_node_t *root, compressor_t *cmp, - size_t block_size, frag_reader_t *frag, int sqfsfd); + size_t block_size, frag_reader_t *frag, int sqfsfd, + int flags); #endif /* UNSQUASHFS_H */ |