X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Freadconf.c;h=9a8b8345975d6aaafef77b3900433e344510c588;hb=13a4b4c1810a1a9f3c956f1e92807a0d86c6f5bf;hp=0233019cf6eb155fcff56dde3c431ceca498a2a0;hpb=47b118b298f8d89fe356792daed1eb807fce7952;p=exim.git diff --git a/src/src/readconf.c b/src/src/readconf.c index 0233019cf..9a8b83459 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -244,7 +244,7 @@ static optionlist optionlist_config[] = { #endif { "pid_file_path", opt_stringptr, &pid_file_path }, { "pipelining_advertise_hosts", opt_stringptr, &pipelining_advertise_hosts }, -#ifdef SUPPORT_PIPE_CONNECT +#ifndef DISABLE_PIPE_CONNECT { "pipelining_connect_advertise_hosts", opt_stringptr, &pipe_connect_advertise_hosts }, #endif @@ -309,7 +309,7 @@ static optionlist optionlist_config[] = { { "smtp_ratelimit_hosts", opt_stringptr, &smtp_ratelimit_hosts }, { "smtp_ratelimit_mail", opt_stringptr, &smtp_ratelimit_mail }, { "smtp_ratelimit_rcpt", opt_stringptr, &smtp_ratelimit_rcpt }, - { "smtp_receive_timeout", opt_func, (void *) &fn_smtp_receive_timeout }, + { "smtp_receive_timeout", opt_func, {.fn = &fn_smtp_receive_timeout} }, { "smtp_reserve_hosts", opt_stringptr, &smtp_reserve_hosts }, { "smtp_return_error_details",opt_bool, &smtp_return_error_details }, #ifdef SUPPORT_I18N @@ -417,6 +417,8 @@ for (struct auth_info * ai = auths_available; ai->driver_name[0]; ai++) spf(buf, sizeof(buf), US"_DRIVER_AUTHENTICATOR_%T", ai->driver_name); builtin_macro_create(buf); options_from_list(ai->options, (unsigned)*ai->options_count, US"AUTHENTICATOR", ai->driver_name); + + if (ai->macros_create) (ai->macros_create)(); } } @@ -484,7 +486,7 @@ typedef struct syslog_fac_item { } syslog_fac_item; /* constants */ -static const char * const hidden = ""; +static const uschar * const hidden = US""; /* Static variables */ @@ -584,7 +586,7 @@ uschar * readconf_find_option(void *p) { for (int i = 0; i < nelem(optionlist_config); i++) - if (p == optionlist_config[i].value) return US optionlist_config[i].name; + if (p == optionlist_config[i].v.value) return US optionlist_config[i].name; for (router_instance * r = routers; r; r = r->next) { @@ -592,7 +594,7 @@ for (router_instance * r = routers; r; r = r->next) for (int i = 0; i < *ri->options_count; i++) { if ((ri->options[i].type & opt_mask) != opt_stringptr) continue; - if (p == CS (r->options_block) + (long int)(ri->options[i].value)) + if (p == CS (r->options_block) + ri->options[i].v.offset) return US ri->options[i].name; } } @@ -608,7 +610,7 @@ for (transport_instance * t = transports; t; t = t->next) ? CS t : CS t->options_block ) - + (long int)op->value) + + op->v.offset) return US op->name; } } @@ -1341,11 +1343,11 @@ get_set_flag(uschar *name, optionlist *oltop, int last, void *data_block) optionlist *ol; uschar name2[64]; sprintf(CS name2, "*set_%.50s", name); -ol = find_option(name2, oltop, last); -if (ol == NULL) log_write(0, LOG_MAIN|LOG_PANIC_DIE, - "Exim internal error: missing set flag for %s", name); -return (data_block == NULL)? (BOOL *)(ol->value) : - (BOOL *)(US data_block + (long int)(ol->value)); +if (!(ol = find_option(name2, oltop, last))) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, + "Exim internal error: missing set flag for %s", name); +return data_block + ? (BOOL *)(US data_block + ol->v.offset) : (BOOL *)ol->v.value; } @@ -1659,7 +1661,7 @@ is set twice, is a disaster. */ if (!(ol = find_option(name + offset, oltop, last))) { - if (unknown_txt == NULL) return FALSE; + if (!unknown_txt) return FALSE; log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, CS unknown_txt, name); } @@ -1678,7 +1680,7 @@ if (type < opt_bool || type > opt_bool_last) if (offset != 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "negation prefix applied to a non-boolean option"); - if (*s == 0) + if (!*s) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "unexpected end of line (data missing) after %s", name); if (*s != '=') @@ -1689,7 +1691,7 @@ if (type < opt_bool || type > opt_bool_last) true/false/yes/no, or, in the case of opt_expand_bool, a general string that ultimately expands to one of those values. */ -else if (*s != 0 && (offset != 0 || *s != '=')) +else if (*s && (offset != 0 || *s != '=')) extra_chars_error(s, US"boolean option ", name, US""); /* Skip white space after = */ @@ -1699,7 +1701,7 @@ if (*s == '=') while (isspace((*(++s)))); /* If there is a data block and the opt_public flag is not set, change the data block pointer to the private options block. */ -if (data_block != NULL && (ol->type & opt_public) == 0) +if (data_block && !(ol->type & opt_public)) data_block = (void *)(((driver_instance *)data_block)->options_block); /* Now get the data according to the type. */ @@ -1746,8 +1748,8 @@ switch (type) control block and flags word. */ case opt_stringptr: - str_target = data_block ? USS (US data_block + (long int)(ol->value)) - : USS (ol->value); + str_target = data_block ? USS (US data_block + ol->v.offset) + : USS ol->v.value; if (ol->type & opt_rep_con) { uschar * saved_condition; @@ -1805,9 +1807,9 @@ switch (type) case opt_rewrite: if (data_block) - *USS (US data_block + (long int)(ol->value)) = sptr; + *USS (US data_block + ol->v.offset) = sptr; else - *USS (ol->value) = sptr; + *USS ol->v.value = sptr; freesptr = FALSE; if (type == opt_rewrite) { @@ -1822,19 +1824,19 @@ switch (type) sprintf(CS name2, "*%.50s_flags", name); ol3 = find_option(name2, oltop, last); - if (ol2 == NULL || ol3 == NULL) + if (!ol2 || !ol3) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "rewrite rules not available for driver"); - if (data_block == NULL) + if (data_block) { - chain = (rewrite_rule **)(ol2->value); - flagptr = (int *)(ol3->value); + chain = (rewrite_rule **)(US data_block + ol2->v.offset); + flagptr = (int *)(US data_block + ol3->v.offset); } else { - chain = (rewrite_rule **)(US data_block + (long int)(ol2->value)); - flagptr = (int *)(US data_block + (long int)(ol3->value)); + chain = (rewrite_rule **)ol2->v.value; + flagptr = (int *)ol3->v.value; } while ((p = string_nextinlist(CUSS &sptr, &sep, big_buffer, BIG_BUFFER_SIZE))) @@ -1858,17 +1860,16 @@ switch (type) case opt_expand_uid: sprintf(CS name2, "*expand_%.50s", name); - ol2 = find_option(name2, oltop, last); - if (ol2 != NULL) + if ((ol2 = find_option(name2, oltop, last))) { - uschar *ss = (Ustrchr(sptr, '$') != NULL)? sptr : NULL; + uschar *ss = (Ustrchr(sptr, '$') != NULL) ? sptr : NULL; - if (data_block == NULL) - *((uschar **)(ol2->value)) = ss; + if (data_block) + *(USS(US data_block + ol2->v.offset)) = ss; else - *((uschar **)(US data_block + (long int)(ol2->value))) = ss; + *(USS ol2->v.value) = ss; - if (ss != NULL) + if (ss) { *(get_set_flag(name, oltop, last, data_block)) = FALSE; freesptr = FALSE; @@ -1882,10 +1883,10 @@ switch (type) case opt_uid: if (!route_finduser(sptr, &pw, &uid)) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "user %s was not found", sptr); - if (data_block == NULL) - *((uid_t *)(ol->value)) = uid; + if (data_block) + *(uid_t *)(US data_block + ol->v.offset) = uid; else - *((uid_t *)(US data_block + (long int)(ol->value))) = uid; + *(uid_t *)ol->v.value = uid; /* Set the flag indicating a fixed value is set */ @@ -1898,16 +1899,16 @@ switch (type) if (pw == NULL) break; Ustrcpy(name+Ustrlen(name)-4, US"group"); ol2 = find_option(name, oltop, last); - if (ol2 != NULL && ((ol2->type & opt_mask) == opt_gid || + if (ol2 && ((ol2->type & opt_mask) == opt_gid || (ol2->type & opt_mask) == opt_expand_gid)) { BOOL *set_flag = get_set_flag(name, oltop, last, data_block); - if (! *set_flag) + if (!*set_flag) { - if (data_block == NULL) - *((gid_t *)(ol2->value)) = pw->pw_gid; + if (data_block) + *((gid_t *)(US data_block + ol2->v.offset)) = pw->pw_gid; else - *((gid_t *)(US data_block + (long int)(ol2->value))) = pw->pw_gid; + *((gid_t *)ol2->v.value) = pw->pw_gid; *set_flag = TRUE; } } @@ -1921,17 +1922,16 @@ switch (type) case opt_expand_gid: sprintf(CS name2, "*expand_%.50s", name); - ol2 = find_option(name2, oltop, last); - if (ol2 != NULL) + if ((ol2 = find_option(name2, oltop, last))) { - uschar *ss = (Ustrchr(sptr, '$') != NULL)? sptr : NULL; + uschar *ss = (Ustrchr(sptr, '$') != NULL) ? sptr : NULL; - if (data_block == NULL) - *((uschar **)(ol2->value)) = ss; + if (data_block) + *(USS(US data_block + ol2->v.offset)) = ss; else - *((uschar **)(US data_block + (long int)(ol2->value))) = ss; + *(USS ol2->v.value) = ss; - if (ss != NULL) + if (ss) { *(get_set_flag(name, oltop, last, data_block)) = FALSE; freesptr = FALSE; @@ -1944,10 +1944,10 @@ switch (type) case opt_gid: if (!route_findgroup(sptr, &gid)) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "group %s was not found", sptr); - if (data_block == NULL) - *((gid_t *)(ol->value)) = gid; + if (data_block) + *((gid_t *)(US data_block + ol->v.offset)) = gid; else - *((gid_t *)(US data_block + (long int)(ol->value))) = gid; + *((gid_t *)ol->v.value) = gid; *(get_set_flag(name, oltop, last, data_block)) = TRUE; break; @@ -1974,10 +1974,10 @@ switch (type) list = store_malloc(count*sizeof(uid_t)); list[ptr++] = (uid_t)(count - 1); - if (data_block == NULL) - *((uid_t **)(ol->value)) = list; + if (data_block) + *((uid_t **)(US data_block + ol->v.offset)) = list; else - *((uid_t **)(US data_block + (long int)(ol->value))) = list; + *((uid_t **)ol->v.value) = list; p = op; while (count-- > 1) @@ -2005,7 +2005,7 @@ switch (type) const uschar *p; const uschar *op = expand_string (sptr); - if (op == NULL) + if (!op) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "failed to expand %s: %s", name, expand_string_message); @@ -2015,10 +2015,10 @@ switch (type) list = store_malloc(count*sizeof(gid_t)); list[ptr++] = (gid_t)(count - 1); - if (data_block == NULL) - *((gid_t **)(ol->value)) = list; + if (data_block) + *((gid_t **)(US data_block + ol->v.offset)) = list; else - *((gid_t **)(US data_block + (long int)(ol->value))) = list; + *((gid_t **)ol->v.value) = list; p = op; while (count-- > 1) @@ -2044,17 +2044,17 @@ switch (type) save the string for later expansion in the alternate place. */ case opt_expand_bool: - if (*s != 0 && Ustrchr(s, '$') != 0) + if (*s && Ustrchr(s, '$') != 0) { sprintf(CS name2, "*expand_%.50s", name); if ((ol2 = find_option(name2, oltop, last))) { reset_point = store_mark(); sptr = read_string(s, name); - if (data_block == NULL) - *((uschar **)(ol2->value)) = sptr; + if (data_block) + *(USS(US data_block + ol2->v.offset)) = sptr; else - *((uschar **)(US data_block + (long int)(ol2->value))) = sptr; + *(USS ol2->v.value) = sptr; freesptr = FALSE; break; } @@ -2090,33 +2090,30 @@ switch (type) if (type == opt_bit) { int bit = 1 << ((ol->type >> 16) & 31); - int *ptr = (data_block == NULL)? - (int *)(ol->value) : - (int *)(US data_block + (long int)ol->value); + int * ptr = data_block + ? (int *)(US data_block + ol->v.offset) + : (int *)ol->v.value; if (boolvalue) *ptr |= bit; else *ptr &= ~bit; break; } /* Handle full BOOL types */ - if (data_block == NULL) - *((BOOL *)(ol->value)) = boolvalue; + if (data_block) + *((BOOL *)(US data_block + ol->v.offset)) = boolvalue; else - *((BOOL *)(US data_block + (long int)(ol->value))) = boolvalue; + *((BOOL *)ol->v.value) = boolvalue; /* Verify fudge */ if (type == opt_bool_verify) { sprintf(CS name2, "%.50s_recipient", name + offset); - ol2 = find_option(name2, oltop, last); - if (ol2 != NULL) - { - if (data_block == NULL) - *((BOOL *)(ol2->value)) = boolvalue; + if ((ol2 = find_option(name2, oltop, last))) + if (data_block) + *((BOOL *)(US data_block + ol2->v.offset)) = boolvalue; else - *((BOOL *)(US data_block + (long int)(ol2->value))) = boolvalue; - } + *((BOOL *)ol2->v.value) = boolvalue; } /* Note that opt_bool_set type is set, if there is somewhere to do so */ @@ -2124,14 +2121,11 @@ switch (type) else if (type == opt_bool_set) { sprintf(CS name2, "*set_%.50s", name + offset); - ol2 = find_option(name2, oltop, last); - if (ol2 != NULL) - { - if (data_block == NULL) - *((BOOL *)(ol2->value)) = TRUE; + if ((ol2 = find_option(name2, oltop, last))) + if (data_block) + *((BOOL *)(US data_block + ol2->v.offset)) = TRUE; else - *((BOOL *)(US data_block + (long int)(ol2->value))) = TRUE; - } + *((BOOL *)ol2->v.value) = TRUE; } break; @@ -2189,9 +2183,9 @@ switch (type) } if (data_block) - *(int *)(US data_block + (long int)ol->value) = value; + *(int *)(US data_block + ol->v.offset) = value; else - *(int *)ol->value = value; + *(int *)ol->v.value = value; break; /* Integer held in K: again, allow formats and suffixes as above. */ @@ -2235,9 +2229,9 @@ switch (type) extra_chars_error(endptr, inttype, US"integer value for ", name); if (data_block) - *(int_eximarith_t *)(US data_block + (long int)ol->value) = lvalue; + *(int_eximarith_t *)(US data_block + ol->v.offset) = lvalue; else - *(int_eximarith_t *)ol->value = lvalue; + *(int_eximarith_t *)ol->v.value = lvalue; break; } @@ -2276,10 +2270,10 @@ switch (type) if (s[count] != 0) extra_chars_error(s+count, US"fixed-point value for ", name, US""); - if (data_block == NULL) - *((int *)(ol->value)) = value; + if (data_block) + *((int *)(US data_block + ol->v.offset)) = value; else - *((int *)(US data_block + (long int)(ol->value))) = value; + *((int *)ol->v.value) = value; break; /* There's a special routine to read time values. */ @@ -2289,10 +2283,10 @@ switch (type) if (value < 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "invalid time value for %s", name); - if (data_block == NULL) - *((int *)(ol->value)) = value; + if (data_block) + *((int *)(US data_block + ol->v.offset)) = value; else - *((int *)(US data_block + (long int)(ol->value))) = value; + *((int *)ol->v.value) = value; break; /* A time list is a list of colon-separated times, with the first @@ -2302,9 +2296,9 @@ switch (type) case opt_timelist: { int count = 0; - int *list = (data_block == NULL)? - (int *)(ol->value) : - (int *)(US data_block + (long int)(ol->value)); + int * list = data_block + ? (int *)(US data_block + ol->v.offset) + : (int *)ol->v.value; if (*s != 0) for (count = 1; count <= list[0] - 2; count++) { @@ -2339,7 +2333,7 @@ switch (type) case opt_func: { - void (*fn)() = ol->value; + void (*fn)() = ol->v.fn; fn(name, s, 0); break; } @@ -2441,15 +2435,15 @@ if (!ol) if (!f.admin_user && ol->type & opt_secure) { if (no_labels) - printf("%s\n", hidden); + printf("%s\n", CCS hidden); else - printf("%s = %s\n", name, hidden); + printf("%s = %s\n", name, CCS hidden); return TRUE; } /* Else show the value of the option */ -value = ol->value; +value = ol->v.value; if (options_block) { if (!(ol->type & opt_public)) @@ -2542,10 +2536,10 @@ switch(ol->type & opt_mask) sprintf(CS name2, "*expand_%.50s", name); if ((ol2 = find_option(name2, oltop, last))) { - void *value2 = ol2->value; if (options_block) - value2 = (void *)(US options_block + (long int)value2); - s = *(USS value2); + s = *USS (US options_block + ol2->v.offset); + else + s = *USS ol2->v.value; if (!no_labels) printf("%s = ", name); printf("%s\n", s ? string_printing(s) : US""); break; @@ -2574,10 +2568,10 @@ switch(ol->type & opt_mask) if ( (ol2 = find_option(name2, oltop, last)) && (ol2->type & opt_mask) == opt_stringptr) { - void *value2 = ol2->value; if (options_block) - value2 = (void *)(US options_block + (long int)value2); - s = *(USS value2); + s = *USS (US options_block + ol2->v.offset); + else + s = *USS ol2->v.value; if (!no_labels) printf("%s = ", name); printf("%s\n", s ? string_printing(s) : US""); break; @@ -2657,12 +2651,12 @@ switch(ol->type & opt_mask) case opt_expand_bool: sprintf(CS name2, "*expand_%.50s", name); - if ((ol2 = find_option(name2, oltop, last)) && ol2->value) + if ((ol2 = find_option(name2, oltop, last)) && ol2->v.value) { - void *value2 = ol2->value; if (options_block) - value2 = (void *)(US options_block + (long int)value2); - s = *(USS value2); + s = *USS (US options_block + ol2->v.offset); + else + s = *USS ol2->v.value; if (s) { if (!no_labels) printf("%s = ", name); @@ -2681,11 +2675,8 @@ switch(ol->type & opt_mask) break; case opt_func: - { - void (*fn)() = ol->value; - fn(name, NULL, no_labels ? opt_fn_print : opt_fn_print|opt_fn_print_label); + ol->v.fn(name, NULL, no_labels ? opt_fn_print : opt_fn_print|opt_fn_print_label); break; - } } return TRUE; } @@ -2751,12 +2742,13 @@ if (!type) for (int i = 0; i < 4; i++) if ((t = tree_search(*(anchors[i]), name+1))) { + namedlist_block * nb = t->data.ptr; + const uschar * s = nb->hide ? hidden : nb->string; found = TRUE; if (no_labels) - printf("%s\n", ((namedlist_block *)(t->data.ptr))->string); + printf("%s\n", CCS s); else - printf("%slist %s = %s\n", types[i], name+1, - ((namedlist_block *)(t->data.ptr))->string); + printf("%slist %s = %s\n", types[i], name+1, CCS s); } if (!found) @@ -2977,18 +2969,19 @@ Arguments: s the text of the option line, starting immediately after the name of the list type tname the name of the list type, for messages + hide do not output value on "-bP" Returns: nothing */ static void read_named_list(tree_node **anchorp, int *numberp, int max, uschar *s, - uschar *tname) + uschar *tname, BOOL hide) { BOOL forcecache = FALSE; uschar *ss; tree_node *t; -namedlist_block *nb = store_get(sizeof(namedlist_block), FALSE); +namedlist_block * nb = store_get(sizeof(namedlist_block), FALSE); if (Ustrncmp(s, "_cache", 6) == 0) { @@ -3018,6 +3011,7 @@ if (!tree_insertnode(anchorp, t)) t->data.ptr = nb; nb->number = *numberp; *numberp += 1; +nb->hide = hide; if (*s++ != '=') log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "missing '=' after \"%s\"", t->name); @@ -3074,80 +3068,6 @@ log_write(0, LOG_MAIN|LOG_PANIC_DIE, "malformed ratelimit data: %s", s); -/************************************************* -* Drop privs for checking TLS config * -*************************************************/ - -/* We want to validate TLS options during readconf, but do not want to be -root when we call into the TLS library, in case of library linkage errors -which cause segfaults; before this check, those were always done as the Exim -runtime user and it makes sense to continue with that. - -Assumes: tls_require_ciphers has been set, if it will be - exim_user has been set, if it will be - exim_group has been set, if it will be - -Returns: bool for "okay"; false will cause caller to immediately exit. -*/ - -#ifndef DISABLE_TLS -static BOOL -tls_dropprivs_validate_require_cipher(BOOL nowarn) -{ -const uschar *errmsg; -pid_t pid; -int rc, status; -void (*oldsignal)(int); - -/* If TLS will never be used, no point checking ciphers */ - -if ( !tls_advertise_hosts - || !*tls_advertise_hosts - || Ustrcmp(tls_advertise_hosts, ":") == 0 - ) - return TRUE; -else if (!nowarn && !tls_certificate) - log_write(0, LOG_MAIN, - "Warning: No server certificate defined; will use a selfsigned one.\n" - " Suggested action: either install a certificate or change tls_advertise_hosts option"); - -oldsignal = signal(SIGCHLD, SIG_DFL); - -fflush(NULL); -if ((pid = fork()) < 0) - log_write(0, LOG_MAIN|LOG_PANIC_DIE, "fork failed for TLS check"); - -if (pid == 0) - { - /* in some modes, will have dropped privilege already */ - if (!geteuid()) - exim_setugid(exim_uid, exim_gid, FALSE, - US"calling tls_validate_require_cipher"); - - if ((errmsg = tls_validate_require_cipher())) - log_write(0, LOG_PANIC_DIE|LOG_CONFIG, - "tls_require_ciphers invalid: %s", errmsg); - fflush(NULL); - exim_underbar_exit(0); - } - -do { - rc = waitpid(pid, &status, 0); -} while (rc < 0 && errno == EINTR); - -DEBUG(D_tls) - debug_printf("tls_validate_require_cipher child %d ended: status=0x%x\n", - (int)pid, status); - -signal(SIGCHLD, oldsignal); - -return status == 0; -} -#endif /*DISABLE_TLS*/ - - - - /************************************************* * Read main configuration options * *************************************************/ @@ -3350,28 +3270,36 @@ a macro definition. */ while ((s = get_config_line())) { + BOOL hide; + uschar * t; + if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf") == s) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "found unexpected BOM (Byte Order Mark)"); - if (isupper(s[0])) - { if (!macro_read_assignment(s)) exim_exit(EXIT_FAILURE, US""); } + if (isupper(*s)) + { + if (!macro_read_assignment(s)) exim_exit(EXIT_FAILURE, US""); + continue; + } + + t = (hide = Ustrncmp(s, "hide", 4) == 0 && isspace(s[4])) ? s + 5 : s; - else if (Ustrncmp(s, "domainlist", 10) == 0) + if (Ustrncmp(t, "domainlist", 10) == 0) read_named_list(&domainlist_anchor, &domainlist_count, - MAX_NAMED_LIST, s+10, US"domain list"); + MAX_NAMED_LIST, t+10, US"domain list", hide); - else if (Ustrncmp(s, "hostlist", 8) == 0) + else if (Ustrncmp(t, "hostlist", 8) == 0) read_named_list(&hostlist_anchor, &hostlist_count, - MAX_NAMED_LIST, s+8, US"host list"); + MAX_NAMED_LIST, t+8, US"host list", hide); - else if (Ustrncmp(s, US"addresslist", 11) == 0) + else if (Ustrncmp(t, US"addresslist", 11) == 0) read_named_list(&addresslist_anchor, &addresslist_count, - MAX_NAMED_LIST, s+11, US"address list"); + MAX_NAMED_LIST, t+11, US"address list", hide); - else if (Ustrncmp(s, US"localpartlist", 13) == 0) + else if (Ustrncmp(t, US"localpartlist", 13) == 0) read_named_list(&localpartlist_anchor, &localpartlist_count, - MAX_NAMED_LIST, s+13, US"local part list"); + MAX_NAMED_LIST, t+13, US"local part list", hide); else (void) readconf_handle_option(s, optionlist_config, optionlist_config_size, @@ -3645,11 +3573,6 @@ if ((tls_verify_hosts || tls_try_verify_hosts) && !tls_verify_certificates) "tls_%sverify_hosts is set, but tls_verify_certificates is not set", tls_verify_hosts ? "" : "try_"); -/* This also checks that the library linkage is working and we can call -routines in it, so call even if tls_require_ciphers is unset */ -if (!tls_dropprivs_validate_require_cipher(nowarn)) - exit(1); - /* Magic number: at time of writing, 1024 has been the long-standing value used by so many clients, and what Exim used to use always, that it makes sense to just min-clamp this max-clamp at that. */ @@ -3767,7 +3690,7 @@ driver_instance **p = anchor; driver_instance *d = NULL; uschar *buffer; -while ((buffer = get_config_line()) != NULL) +while ((buffer = get_config_line())) { uschar name[64]; uschar *s; @@ -3788,6 +3711,7 @@ while ((buffer = get_config_line()) != NULL) if (!d->driver_name) log_write(0, LOG_PANIC_DIE|LOG_CONFIG, "no driver defined for %s \"%s\"", class, d->name); + /* s is using big_buffer, so this call had better not */ (d->info->init)(d); d = NULL; } @@ -3835,7 +3759,7 @@ while ((buffer = get_config_line()) != NULL) /* Check nothing more on this line, then do the next loop iteration. */ while (isspace(*s)) s++; - if (*s != 0) extra_chars_error(s, US"driver name ", name, US""); + if (*s) extra_chars_error(s, US"driver name ", name, US""); continue; } @@ -3905,22 +3829,20 @@ int count = *(d->info->options_count); uschar *ss; for (optionlist * ol = d->info->options; ol < d->info->options + count; ol++) - { - void *options_block; - uschar *value; - int type = ol->type & opt_mask; - if (type != opt_stringptr) continue; - options_block = ((ol->type & opt_public) == 0)? d->options_block : (void *)d; - value = *(uschar **)(US options_block + (long int)(ol->value)); - if (value != NULL && (ss = Ustrstr(value, s)) != NULL) + if ((ol->type & opt_mask) == opt_stringptr) { - if (ss <= value || (ss[-1] != '$' && ss[-1] != '{') || - isalnum(ss[Ustrlen(s)])) continue; - DEBUG(D_transport) debug_printf("driver %s: \"%s\" option depends on %s\n", - d->name, ol->name, s); - return TRUE; + void * options_block = ol->type & opt_public ? (void *)d : d->options_block; + uschar * value = *USS(US options_block + ol->v.offset); + + if (value && (ss = Ustrstr(value, s)) != NULL) + { + if (ss <= value || (ss[-1] != '$' && ss[-1] != '{') || + isalnum(ss[Ustrlen(s)])) continue; + DEBUG(D_transport) debug_printf("driver %s: \"%s\" option depends on %s\n", + d->name, ol->name, s); + return TRUE; + } } - } DEBUG(D_transport) debug_printf("driver %s does not depend on %s\n", d->name, s); return FALSE; @@ -4222,7 +4144,7 @@ Returns: nothing static void auths_init(void) { -#ifdef SUPPORT_PIPE_CONNECT +#ifndef DISABLE_PIPE_CONNECT int nauths = 0; #endif @@ -4248,11 +4170,11 @@ for (auth_instance * au = auths; au; au = au->next) "(%s and %s) have the same public name (%s)", au->client ? US"client" : US"server", au->name, bu->name, au->public_name); -#ifdef SUPPORT_PIPE_CONNECT +#ifndef DISABLE_PIPE_CONNECT nauths++; #endif } -#ifdef SUPPORT_PIPE_CONNECT +#ifndef DISABLE_PIPE_CONNECT f.smtp_in_early_pipe_no_auth = nauths > 16; #endif } @@ -4351,10 +4273,8 @@ log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "local_scan() options not supported: " uschar *p; while ((p = get_config_line())) - { (void) readconf_handle_option(p, local_scan_options, local_scan_options_count, NULL, US"local_scan option \"%s\" unknown"); - } #endif } @@ -4539,11 +4459,11 @@ for (config_line_item * i = config_lines; i; i = i->next) if ((p = Ustrchr(current, '='))) { *p = '\0'; - printf("%*s%s= %s\n", indent, "", current, hidden); + printf("%*s%s= %s\n", indent, "", current, CCS hidden); } /* e.g.: hide split_spool_directory */ else - printf("%*s\n", indent, hidden); + printf("%*s\n", indent, CCS hidden); } else