* Exim - an Internet mail transport agent *
*************************************************/
+/* Copyright (c) The Exim Maintainers 2010 - 2022 */
/* Copyright (c) University of Cambridge 1995 - 2009 */
-/* Copyright (c) The Exim Maintainers 2017 */
/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "exim.h"
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);
/* Set the ownership if necessary. */
- if (use_chown && Uchown(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
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;
}