From e21bf0b60c1b9d67fe7553105b6440c3fce7c0bb Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 7 Oct 2019 15:54:41 +0200 Subject: Do an explicit "is filename sane" check Until now, filenames containing '/' or being equal to '..' or '.' where not handled explicitly, because they are canonicalized later, which will then fail. This commit adds an explicit check to make those fail immediately with a clear, specific error message. Signed-off-by: David Oberhollenzer --- include/common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 17d709e..ba42054 100644 --- a/include/common.h +++ b/include/common.h @@ -140,6 +140,7 @@ 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); /* A wrapper around mkdir() that behaves like 'mkdir -p'. It tries to create -- cgit v1.2.3