TLS: Session resumption, under the EXPERIMENTAL_TLS_RESUME build option.
[exim.git] / src / src / exim.c
index 2dbc41162513504d9c5df13b8815df743b6a0e8d..1952d91a46fb4a1965c67cc117d36a31c4c67564 100644 (file)
@@ -690,6 +690,7 @@ of chown()/fchown().  See src/functions.h for more explanation */
 int
 exim_chown_failure(int fd, const uschar *name, uid_t owner, gid_t group)
 {
+int saved_errno = errno;  /* from the preceeding chown call */
 #if 1
 log_write(0, LOG_MAIN|LOG_PANIC,
   __FILE__ ":%d: chown(%s, %d:%d) failed (%s)."
@@ -701,7 +702,6 @@ log_write(0, LOG_MAIN|LOG_PANIC,
    See Bug 2391
    HS 2019-04-18 */
 
-int saved_errno = errno;  /* from the preceeding chown call */
 struct stat buf;
 
 if (0 == (fd < 0 ? stat(name, &buf) : fstat(fd, &buf)))
@@ -711,9 +711,9 @@ if (0 == (fd < 0 ? stat(name, &buf) : fstat(fd, &buf)))
 }
 else log_write(0, LOG_MAIN|LOG_PANIC, "Stat failed on %s: %s", name, strerror(errno));
 
+#endif
 errno = saved_errno;
 return -1;
-#endif
 }
 
 
@@ -934,6 +934,9 @@ fprintf(fp, "Support for:");
 #ifdef EXPERIMENTAL_PIPE_CONNECT
   fprintf(fp, " Experimental_PIPE_CONNECT");
 #endif
+#ifdef EXPERIMENTAL_TLS_RESUME
+  fprintf(fp, " Experimental_TLS_resume");
+#endif
 fprintf(fp, "\n");
 
 fprintf(fp, "Lookups (built-in):");
@@ -4192,6 +4195,7 @@ if (!unprivileged &&                      /* originally had root AND */
 else
   {
   int rv;
+  DEBUG(D_any) debug_printf("dropping to exim gid; retaining priv uid\n");
   rv = setgid(exim_gid);
   /* Impact of failure is that some stuff might end up with an incorrect group.
   We track this for failures from root, since any attempt to change privilege