X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/c193398df07b9917b917b38030c4544271024474..1137f3a6938882cc81a1fcd7dc15530e8fae9e32:/src/src/exim.c diff --git a/src/src/exim.c b/src/src/exim.c index acc2af715..5e11559ad 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -365,7 +365,7 @@ return 0; /* Exim uses a time + a pid to generate a unique identifier in two places: its message IDs, and in file names for maildir deliveries. Because some OS now re-use pids within the same second, sub-second times are now being used. -However, for absolute certaintly, we must ensure the clock has ticked before +However, for absolute certainty, we must ensure the clock has ticked before allowing the relevant process to complete. At the time of implementation of this code (February 2003), the speed of processors is such that the clock will invariably have ticked already by the time a process has done its job. This @@ -840,9 +840,15 @@ fprintf(f, "Support for:"); #ifdef SUPPORT_SOCKS fprintf(f, " SOCKS"); #endif +#ifdef TCP_FASTOPEN + fprintf(f, " TCP_Fast_Open"); +#endif #ifdef EXPERIMENTAL_LMDB fprintf(f, " Experimental_LMDB"); #endif +#ifdef EXPERIMENTAL_QUEUEFILE + fprintf(f, " Experimental_QUEUEFILE"); +#endif #ifdef EXPERIMENTAL_SPF fprintf(f, " Experimental_SPF"); #endif @@ -996,6 +1002,9 @@ fprintf(f, "Transports:"); #ifdef TRANSPORT_PIPE fprintf(f, " pipe"); #endif +#ifdef EXPERIMENTAL_QUEUEFILE + fprintf(f, " queuefile"); +#endif #ifdef TRANSPORT_SMTP fprintf(f, " smtp"); #endif @@ -1010,6 +1019,8 @@ if (fixed_never_users[0] > 0) fprintf(f, "%d\n", (unsigned int)fixed_never_users[i]); } +fprintf(f, "Configure owner: %d:%d\n", config_uid, config_gid); + fprintf(f, "Size of off_t: " SIZE_T_FMT "\n", sizeof(off_t)); /* Everything else is details which are only worth reporting when debugging. @@ -1320,7 +1331,7 @@ static void exim_usage(uschar *progname) { -/* Handle specific program invocation varients */ +/* Handle specific program invocation variants */ if (Ustrcmp(progname, US"-mailq") == 0) { fprintf(stderr, @@ -1347,12 +1358,12 @@ exit(EXIT_FAILURE); /* Typically, Exim will drop privileges if macros are supplied. In some cases, we want to not do so. -Arguments: none (macros is a global) +Arguments: opt_D_used - true if the commandline had a "-D" option Returns: true if trusted, false otherwise */ static BOOL -macros_trusted(void) +macros_trusted(BOOL opt_D_used) { #ifdef WHITELIST_D_MACROS macro_item *m; @@ -1362,7 +1373,7 @@ size_t len; BOOL prev_char_item, found; #endif -if (macros == NULL) +if (!opt_D_used) return TRUE; #ifndef WHITELIST_D_MACROS return FALSE; @@ -1688,8 +1699,6 @@ big_buffer = store_malloc(big_buffer_size); descriptive text. */ set_process_info("initializing"); -readconf_features(); -readconf_options(); os_restarting_signal(SIGUSR1, usr1_handler); /* SIGHUP is used to get the daemon to reconfigure. It gets set as appropriate @@ -1891,7 +1900,7 @@ for (i = 1; i < argc; i++) break; } - /* An option consistion of -- terminates the options */ + /* An option consisting of -- terminates the options */ if (Ustrcmp(arg, "--") == 0) { @@ -2448,7 +2457,7 @@ for (i = 1; i < argc; i++) exit(EXIT_FAILURE); } - m = macro_create(name, s, TRUE); + m = macro_create(name, s, TRUE, FALSE); if (clmacro_count >= MAX_CLMACROS) { @@ -3679,7 +3688,7 @@ configuration file changes and macro definitions haven't happened. */ if (( /* EITHER */ (!trusted_config || /* Config changed, or */ - !macros_trusted()) && /* impermissible macros and */ + !macros_trusted(opt_D_used)) && /* impermissible macros and */ real_uid != root_uid && /* Not root, and */ !running_in_test_harness /* Not fudged */ ) || /* OR */ @@ -5078,7 +5087,7 @@ if (host_checking) verify_get_ident(1413); } - /* In case the given address is a non-canonical IPv6 address, canonicize + /* In case the given address is a non-canonical IPv6 address, canonicalize it. The code works for both IPv4 and IPv6, as it happens. */ size = host_aton(sender_host_address, x); @@ -5327,7 +5336,7 @@ February 2003: That's *still* not the end of the story. There are now versions of Linux (where SIG_IGN does work) that are picky. If, having set SIG_IGN, a process then calls waitpid(), a grumble is written to the system log, because this is logically inconsistent. In other words, it doesn't like the paranoia. -As a consequenc of this, the waitpid() below is now excluded if we are sure +As a consequence of this, the waitpid() below is now excluded if we are sure that SIG_IGN works. */ if (!synchronous_delivery) @@ -5531,7 +5540,7 @@ while (more) ignored; rejecting here would just add complication, and it can just as well be done later. Allow $recipients to be visible in the ACL. */ - if (acl_not_smtp_start != NULL) + if (acl_not_smtp_start) { uschar *user_msg, *log_msg; enable_dollar_recipients = TRUE; @@ -5540,6 +5549,20 @@ while (more) enable_dollar_recipients = FALSE; } + /* Pause for a while waiting for input. If none received in that time, + close the logfile, if we had one open; then if we wait for a long-running + datasource (months, in one use-case) log rotation will not leave us holding + the file copy. */ + + if (!receive_timeout) + { + struct timeval t = { 30*60, 0 }; /* 30 minutes */ + fd_set r; + + FD_ZERO(&r); FD_SET(0, &r); + if (select(1, &r, NULL, NULL, &t) == 0) mainlog_close(); + } + /* Read the data for the message. If filter_test is not FTEST_NONE, this will just read the headers for the message, and not write anything onto the spool. */