X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/4328fd3cb019281becab844b6bf560632b1d34b1..1ac6b2e7857d7b6645dbd09047c4c2ac3b6cef1d:/src/src/spool_out.c diff --git a/src/src/spool_out.c b/src/src/spool_out.c index 5df2a414e..ce25a564e 100644 --- a/src/src/spool_out.c +++ b/src/src/spool_out.c @@ -93,10 +93,12 @@ double-check the mode because the group setting doesn't always get set automatically. */ if (fd >= 0) - { - (void)fchown(fd, exim_uid, exim_gid); - (void)fchmod(fd, SPOOL_MODE); - } + if (fchown(fd, exim_uid, exim_gid) || fchmod(fd, SPOOL_MODE)) + { + DEBUG(D_any) debug_printf("failed setting perms on %s\n", temp_name); + (void) close(fd); fd = -1; + Uunlink(temp_name); + } return fd; }