1
/* $Cambridge: exim/exim-src/src/readconf.c,v 1.39 2009/11/16 19:50:37 nm4 Exp $ */
1
/* $Cambridge: exim/src/src/readconf.c,v 1.45 2010/06/12 17:56:32 jetmore Exp $ */
3
3
/*************************************************
4
4
* Exim - an Internet mail transport agent *
294
294
{ "mysql_servers", opt_stringptr, &mysql_servers },
296
296
{ "never_users", opt_uidlist, &never_users },
298
{ "openssl_options", opt_stringptr, &openssl_options },
297
300
#ifdef LOOKUP_ORACLE
298
301
{ "oracle_servers", opt_stringptr, &oracle_servers },
399
402
{ "system_filter_reply_transport",opt_stringptr,&system_filter_reply_transport },
400
403
{ "system_filter_user", opt_uid, &system_filter_uid },
401
404
{ "tcp_nodelay", opt_bool, &tcp_nodelay },
405
#ifdef USE_TCP_WRAPPERS
406
{ "tcp_wrappers_daemon_name", opt_stringptr, &tcp_wrappers_daemon_name },
402
408
{ "timeout_frozen_after", opt_time, &timeout_frozen_after },
403
409
{ "timezone", opt_stringptr, &timezone_string },
404
410
#ifdef SUPPORT_TLS
1423
1432
uschar *mname = name;
1424
1433
if (Ustrncmp(mname, "no_", 3) == 0) mname += 3;
1425
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
1426
"\"%s\" option set for the second time", mname);
1434
if (Ustrcmp(mname, "condition") == 0)
1435
extra_condition = TRUE;
1437
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
1438
"\"%s\" option set for the second time", mname);
1429
1441
ol->type |= opt_set | issecure;
1504
1516
control block and flags word. */
1506
1518
case opt_stringptr:
1519
if (data_block == NULL)
1520
str_target = (uschar **)(ol->value);
1522
str_target = (uschar **)((uschar *)data_block + (long int)(ol->value));
1523
if (extra_condition)
1525
/* We already have a condition, we're conducting a crude hack to let
1526
multiple condition rules be chained together, despite storing them in
1528
saved_condition = *str_target;
1529
strtemp = string_sprintf("${if and{{bool_lax{%s}}{bool_lax{%s}}}}",
1530
saved_condition, sptr);
1531
*str_target = string_copy_malloc(strtemp);
1532
/* TODO(pdp): there is a memory leak here when we set 3 or more
1533
conditions; I still don't understand the store mechanism enough
1534
to know what's the safe way to free content from an earlier store.
1535
AFAICT, stores stack, so freeing an early stored item also stores
1536
all data alloc'd after it. If we knew conditions were adjacent,
1537
we could survive that, but we don't. So I *think* we need to take
1538
another bit from opt_type to indicate "malloced"; this seems like
1539
quite a hack, especially for this one case. It also means that
1540
we can't ever reclaim the store from the *first* condition.
1542
Because we only do this once, near process start-up, I'm prepared to
1543
let this slide for the time being, even though it rankles. */
1507
1552
case opt_rewrite:
1508
1553
if (data_block == NULL)
1509
1554
*((uschar **)(ol->value)) = sptr;
2832
2877
"configuration file %s", filename));
2835
/* Check the status of the file we have opened, unless it was specified on
2836
the command line, in which case privilege was given away at the start. */
2880
/* Check the status of the file we have opened, if we have retained root
2838
if (!config_changed)
2840
2885
if (fstat(fileno(config_file), &statbuf) != 0)
2841
2886
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to stat configuration file %s",
2844
if ((statbuf.st_uid != root_uid && /* owner not root */
2845
statbuf.st_uid != exim_uid /* owner not exim */
2889
if ((statbuf.st_uid != root_uid /* owner not root */
2846
2890
#ifdef CONFIGURE_OWNER
2847
2891
&& statbuf.st_uid != config_uid /* owner not the special one */
2850
(statbuf.st_gid != exim_gid /* group not exim & */
2894
(statbuf.st_gid != root_gid /* group not root & */
2851
2895
#ifdef CONFIGURE_GROUP
2852
2896
&& statbuf.st_gid != config_gid /* group not the special one */
3159
3203
log_write(0, LOG_PANIC_DIE|LOG_CONFIG,
3160
3204
"tls_%sverify_hosts is set, but tls_verify_certificates is not set",
3161
3205
(tls_verify_hosts != NULL)? "" : "try_");
3207
/* If openssl_options is set, validate it */
3208
if (openssl_options != NULL)
3211
log_write(0, LOG_PANIC_DIE|LOG_CONFIG,
3212
"openssl_options is set but we're using GnuTLS");
3215
if (!(tls_openssl_options_parse(openssl_options, &dummy)))
3216
log_write(0, LOG_PANIC_DIE|LOG_CONFIG,
3217
"openssl_options parse error: %s", openssl_options);