X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/05dcfac6f90b695d4e238f9f15fab1cb5d011967..b0b15b7ced28b3c6ddfcd4b0a7e46ee6432a243c:/lib/configuration.c diff --git a/lib/configuration.c b/lib/configuration.c index 5c1d4ce..241d101 100644 --- a/lib/configuration.c +++ b/lib/configuration.c @@ -22,12 +22,8 @@ * @brief Configuration file support */ -#include -#include "types.h" +#include "common.h" -#include -#include -#include #include #include #include @@ -311,7 +307,7 @@ static int set_restrict(const struct config_state *cs, }; for(n = 0; n < nvec; ++n) { - if((i = TABLE_FIND(restrictions, struct restriction, name, vec[n])) < 0) { + if((i = TABLE_FIND(restrictions, name, vec[n])) < 0) { error(0, "%s:%d: invalid restriction '%s'", cs->path, cs->line, vec[n]); return -1; @@ -966,6 +962,7 @@ static const struct conf conf[] = { { C2(restrict, restrictions), &type_restrict, validate_any }, { C(sample_format), &type_sample_format, validate_sample_format }, { C(scratch), &type_string_accum, validate_isreg }, + { C(sendmail), &type_string, validate_isabspath }, { C(short_display), &type_integer, validate_positive }, { C(signal), &type_signal, validate_any }, { C(smtp_server), &type_string, validate_any }, @@ -986,7 +983,7 @@ static const struct conf conf[] = { static const struct conf *find(const char *key) { int n; - if((n = TABLE_FIND(conf, struct conf, name, key)) < 0) + if((n = TABLE_FIND(conf, name, key)) < 0) return 0; return &conf[n]; } @@ -1194,6 +1191,8 @@ static struct config *config_default(void) { c->dbversion = 2; c->cookie_login_lifetime = 86400; c->cookie_key_lifetime = 86400 * 7; + if(sendmail_binary[0] && strcmp(sendmail_binary, "none")) + c->sendmail = xstrdup(sendmail_binary); c->smtp_server = xstrdup("127.0.0.1"); c->new_max = 100; c->reminder_interval = 600; /* 10m */