X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/b66fecb428871a3eb274d9370671f1eaf8c5ccec..ff7829398d74e67f1c1f40339a772fd76708e5ac:/src/src/directory.c diff --git a/src/src/directory.c b/src/src/directory.c index 2d4d565f4..11bf7338b 100644 --- a/src/src/directory.c +++ b/src/src/directory.c @@ -3,7 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2009 */ -/* Copyright (c) The Exim Maintainers 2010 - 2018 */ +/* Copyright (c) The Exim Maintainers 2010 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ #include "exim.h" @@ -44,6 +44,9 @@ uschar c = 1; struct stat statbuf; uschar * path; +if (is_tainted2(name, LOG_MAIN|LOG_PANIC, "Tainted path '%s' for new directory", name)) + { p = US"create"; path = US name; errno = EACCES; goto bad; } + if (parent) { path = string_sprintf("%s%s%s", parent, US"/", name); @@ -85,7 +88,7 @@ return TRUE; bad: if (panic) log_write(0, LOG_MAIN|LOG_PANIC_DIE, - "Failed to %s directory \"%s\": %s\n", p, path, strerror(errno)); + "Failed to %s directory \"%s\": %s\n", p, path, exim_errstr(errno)); return FALSE; }