summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h2
-rw-r--r--include/fstree.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/include/common.h b/include/common.h
index 8b2c66c..bdb3837 100644
--- a/include/common.h
+++ b/include/common.h
@@ -132,8 +132,6 @@ void sqfs_writer_cleanup(sqfs_writer_t *sqfs);
void sqfs_perror(const char *file, const char *action, int error_code);
-bool is_filename_sane(const char *name, bool check_os_specific);
-
/*
A wrapper around mkdir() that behaves like 'mkdir -p'. It tries to create
every component of the given path and skips already existing entries.
diff --git a/include/fstree.h b/include/fstree.h
index 7bc92fd..4ff8c5f 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -181,4 +181,14 @@ char *fstree_get_path(tree_node_t *node);
*/
int canonicalize_name(char *filename);
+/*
+ Returns true if a given filename is sane, false if it is not (e.g. contains
+ slashes or it is equal to '.' or '..').
+
+ If check_os_specific is true, this also checks if the filename contains
+ a character, or is equal to a name, that is black listed on the current OS.
+ E.g. on Windows, a file named "COM0" or "AUX" is a no-no.
+ */
+bool is_filename_sane(const char *name, bool check_os_specific);
+
#endif /* FSTREE_H */