summaryrefslogtreecommitdiff
path: root/unpack/restore_fstree.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-09 15:52:38 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-09 15:56:01 +0100
commitdad9228494e3cc03dc477e8109f43119390b53c4 (patch)
tree17d4c2729d331e3858f5184703bd85744448b6d1 /unpack/restore_fstree.c
parent6d7db2bd7ce39621f27f9f669690ab606ddc1787 (diff)
Only check for OS specific bad filenames when unpacking
When converting a SquashFS image to a tarball, it makes no sense to refuse conversion if the filename is considered evil by the OS. This patch adds an option to is_filename_sane to check if the OS has a problem with the given file name. sqfs2tar sets it to false and converts everything while rdsquashfs sets it to true when unpacking. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/restore_fstree.c')
-rw-r--r--unpack/restore_fstree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unpack/restore_fstree.c b/unpack/restore_fstree.c
index 1de9b05..00d75ef 100644
--- a/unpack/restore_fstree.c
+++ b/unpack/restore_fstree.c
@@ -112,7 +112,7 @@ static int create_node_dfs(const sqfs_tree_node_t *n, int flags)
char *name;
int ret;
- if (!is_filename_sane((const char *)n->name)) {
+ if (!is_filename_sane((const char *)n->name, true)) {
fprintf(stderr, "Found an entry named '%s', skipping.\n",
n->name);
return 0;
@@ -207,7 +207,7 @@ static int set_attribs(sqfs_xattr_reader_t *xattr,
char *path;
int ret;
- if (!is_filename_sane((const char *)n->name))
+ if (!is_filename_sane((const char *)n->name, true))
return 0;
if (S_ISDIR(n->inode->base.mode)) {