git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build: use pkg-config for i18n
[exim.git]
/
src
/
src
/
directory.c
diff --git
a/src/src/directory.c
b/src/src/directory.c
index 64dfac833a728e4c66d4529f03f53db17e762a48..84646b4b3017396f58188ee7c01feee7ec57bc43 100644
(file)
--- a/
src/src/directory.c
+++ b/
src/src/directory.c
@@
-2,9
+2,10
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
+/* Copyright (c) The Exim Maintainers 2010 - 2024 */
/* Copyright (c) University of Cambridge 1995 - 2009 */
/* Copyright (c) University of Cambridge 1995 - 2009 */
-/* Copyright (c) The Exim Maintainers 2017 */
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "exim.h"
#include "exim.h"
@@
-35,7
+36,7
@@
Returns: panic on failure if panic is set; otherwise return FALSE;
*/
BOOL
*/
BOOL
-directory_make(const uschar *
parent, const uschar *
name,
+directory_make(const uschar *
parent, const uschar *
name,
int mode, BOOL panic)
{
BOOL use_chown = parent == spool_directory && geteuid() == root_uid;
int mode, BOOL panic)
{
BOOL use_chown = parent == spool_directory && geteuid() == root_uid;
@@
-44,6
+45,9
@@
uschar c = 1;
struct stat statbuf;
uschar * path;
struct stat statbuf;
uschar * path;
+if (is_tainted(name))
+ { p = US"create"; path = US name; errno = ERRNO_TAINT; goto bad; }
+
if (parent)
{
path = string_sprintf("%s%s%s", parent, US"/", name);
if (parent)
{
path = string_sprintf("%s%s%s", parent, US"/", name);
@@
-69,7
+73,7
@@
while (c && *p)
/* Set the ownership if necessary. */
/* Set the ownership if necessary. */
- if (use_chown &&
U
chown(path, exim_uid, exim_gid))
+ if (use_chown &&
exim_
chown(path, exim_uid, exim_gid))
{ p = US"set owner on"; goto bad; }
/* It appears that any mode bits greater than 0777 are ignored by
{ p = US"set owner on"; goto bad; }
/* It appears that any mode bits greater than 0777 are ignored by
@@
-85,7
+89,7
@@
return TRUE;
bad:
if (panic) log_write(0, LOG_MAIN|LOG_PANIC_DIE,
bad:
if (panic) log_write(0, LOG_MAIN|LOG_PANIC_DIE,
- "Failed to %s directory \"%s\": %s\n", p, path,
strerro
r(errno));
+ "Failed to %s directory \"%s\": %s\n", p, path,
exim_errst
r(errno));
return FALSE;
}
return FALSE;
}