X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Freadconf.c;h=27a834b3f7234cd21105b0f0a93e86a8f0f54a83;hb=e3555426308395ef260b0dae4548593ac114aed5;hp=a452a46d533dc24a5a1bc3f2f9222e480343cffd;hpb=8e6c4db10e5b9bc2fa89a7b5d38fcf12bb03fd2f;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/readconf.c b/src/src/readconf.c index a452a46d5..27a834b3f 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -445,6 +445,7 @@ static optionlist optionlist_config[] = { { "strip_trailing_dot", opt_bool, &strip_trailing_dot }, { "syslog_duplication", opt_bool, &syslog_duplication }, { "syslog_facility", opt_stringptr, &syslog_facility_str }, + { "syslog_pid", opt_bool, &syslog_pid }, { "syslog_processname", opt_stringptr, &syslog_processname }, { "syslog_timestamp", opt_bool, &syslog_timestamp }, { "system_filter", opt_stringptr, &system_filter }, @@ -567,6 +568,7 @@ macro_create(const uschar * name, const uschar * val, unsigned namelen = Ustrlen(name); macro_item * m = store_get(sizeof(macro_item) + namelen); +/* fprintf(stderr, "%s: '%s' '%s'\n", __FUNCTION__, name, val) */ if (!macros) { macros = m; @@ -604,7 +606,7 @@ Arguments: Returns: nothing */ -void +static void read_macro_assignment(uschar *s) { uschar name[64]; @@ -762,6 +764,9 @@ due to conflicts with other common macros. */ #ifdef SUPPORT_SOCKS macro_create(US"_HAVE_SOCKS", US"y", FALSE, TRUE); #endif +#ifdef TCP_FASTOPEN + macro_create(US"_HAVE_TCP_FASTOPEN", US"y", FALSE, TRUE); +#endif #ifdef EXPERIMENTAL_LMDB macro_create(US"_HAVE_LMDB", US"y", FALSE, TRUE); #endif @@ -862,8 +867,14 @@ readconf_options_from_list(optionlist * opts, unsigned nopt, uschar * group) int i; const uschar * s; -/* Walk the array backwards to get substring-conflict names */ -for (i = nopt-1; i >= 0; i--) if (*(s = opts[i].name) && *s != '*') +/* The 'previously-defined-substring' rule for macros in config file +lines is done so for these builtin macros: we know that the table +we source from is in strict alpha order, hence the builtins portion +of the macros list is in reverse-alpha (we prepend them) - so longer +macros that have substrings are always discovered first during +expansion. */ + +for (i = 0; i < nopt; i++) if (*(s = opts[i].name) && *s != '*') macro_create(string_sprintf("_OPT_%T_%T", group, s), US"y", FALSE, TRUE); } @@ -1006,6 +1017,7 @@ for (;;) for (t = s; (p = CUstrchr(t, '_')); t = p+1) if (c = p[1], c == 'O' || c == 'D' || c == 'H') { +/* fprintf(stderr, "%s: builtins create triggered by '%s'\n", __FUNCTION__, s); */ macros_create_builtin(); break; } @@ -1025,6 +1037,7 @@ for (;;) int moveby; int replen = Ustrlen(m->replacement); +/* fprintf(stderr, "%s: matched '%s' in '%s'\n", __FUNCTION__, m->name, t) */ /* Expand the buffer if necessary */ while (newlen - m->namelen + replen + 1 > big_buffer_size) @@ -2334,6 +2347,11 @@ switch (type) if (value < 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "integer \"%s\" is too large (overflow)", s); + /* We get a coverity error here for using count, as it derived + from the tainted buffer pointed to by s, as parsed by sscanf(). + By the definition of sscanf we must be aceessing between start + and end of s (assuming it is nul-terminated...) so ignore the error. */ + /* coverity[tainted_data] */ if (s[count] == '.') { int d = 100;