X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f9ba5e2255cf18092750fffacb6a9603571a2be5..5c161fa615ab4a2d40170fedd71d1b9a7f079ff6:/src/src/directory.c diff --git a/src/src/directory.c b/src/src/directory.c index e5b655186..f54a781b7 100644 --- a/src/src/directory.c +++ b/src/src/directory.c @@ -44,6 +44,9 @@ uschar c = 1; 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); @@ -69,7 +72,7 @@ while (c && *p) /* 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 @@ -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; }