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
tidying
[exim.git]
/
src
/
src
/
rda.c
diff --git
a/src/src/rda.c
b/src/src/rda.c
index aed8abc246b54b5e1a764f0e13171c827f958542..a12e5de2974719ac9e9cd48fb00a4d01e25a06c4 100644
(file)
--- a/
src/src/rda.c
+++ b/
src/src/rda.c
@@
-179,10
+179,8
@@
struct stat statbuf;
/* Reading a file is a form of expansion; we wish to deny attackers the
capability to specify the file name. */
/* Reading a file is a form of expansion; we wish to deny attackers the
capability to specify the file name. */
-if (
is_tainted(filename
))
+if (
(*error = is_tainted2(filename, 0, "Tainted name '%s' for file read not permitted\n", filename)
))
{
{
- *error = string_sprintf("Tainted name '%s' for file read not permitted\n",
- filename);
*yield = FF_ERROR;
return NULL;
}
*yield = FF_ERROR;
return NULL;
}
@@
-222,7
+220,7
@@
if (!(fwd = Ufopen(filename, "rb"))) switch(errno)
DEFAULT_ERROR:
default:
DEFAULT_ERROR:
default:
- *error = string_open_failed(
errno,
"%s", filename);
+ *error = string_open_failed("%s", filename);
*yield = FF_ERROR;
return NULL;
}
*yield = FF_ERROR;
return NULL;
}
@@
-618,9
+616,14
@@
search_tidyup();
if ((pid = exim_fork(US"router-interpret")) == 0)
{
header_line *waslast = header_last; /* Save last header */
if ((pid = exim_fork(US"router-interpret")) == 0)
{
header_line *waslast = header_last; /* Save last header */
+ int fd_flags = -1;
fd = pfd[pipe_write];
(void)close(pfd[pipe_read]);
fd = pfd[pipe_write];
(void)close(pfd[pipe_read]);
+
+ if ((fd_flags = fcntl(fd, F_GETFD)) == -1) goto bad;
+ if (fcntl(fd, F_SETFD, fd_flags | FD_CLOEXEC) == -1) goto bad;
+
exim_setugid(ugid->uid, ugid->gid, FALSE, rname);
/* Addresses can get rewritten in filters; if we are not root or the exim
exim_setugid(ugid->uid, ugid->gid, FALSE, rname);
/* Addresses can get rewritten in filters; if we are not root or the exim