X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fspool_out.c;h=ce25a564efd4d18c4c21fdc6e168bd21a771a0de;hb=aa26e1378803587c24924ad0055318959d597802;hp=1a380dd174661a041d42039be42f3716f387b457;hpb=3ecab1575ef1f45a5e7cd3c48cd937ffa8eb0ad9;p=exim.git diff --git a/src/src/spool_out.c b/src/src/spool_out.c index 1a380dd17..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; } @@ -226,10 +228,10 @@ if (bmi_verdicts != NULL) fprintf(f, "-bmi_verdicts %s\n", bmi_verdicts); #endif #ifdef SUPPORT_TLS -if (tls_certificate_verified) fprintf(f, "-tls_certificate_verified\n"); -if (tls_cipher != NULL) fprintf(f, "-tls_cipher %s\n", tls_cipher); -if (tls_peerdn != NULL) fprintf(f, "-tls_peerdn %s\n", string_printing(tls_peerdn)); -if (tls_sni != NULL) fprintf(f, "-tls_sni %s\n", string_printing(tls_sni)); +if (tls_in.certificate_verified) fprintf(f, "-tls_certificate_verified\n"); +if (tls_in.cipher != NULL) fprintf(f, "-tls_cipher %s\n", tls_in.cipher); +if (tls_in.peerdn != NULL) fprintf(f, "-tls_peerdn %s\n", string_printing(tls_in.peerdn)); +if (tls_in.sni != NULL) fprintf(f, "-tls_sni %s\n", string_printing(tls_in.sni)); #endif /* To complete the envelope, write out the tree of non-recipients, followed by