From: Timo Sirainen Date: Tue, 12 May 2009 00:08:39 +0000 (-0400) Subject: auth settings: Make sure we have a section name defined. X-Git-Tag: 2.0.alpha1~791 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d477acb83e14a776ece4ca94dcd1869e75d0c6ee;p=thirdparty%2Fdovecot%2Fcore.git auth settings: Make sure we have a section name defined. --HG-- branch : HEAD --- diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index 6539a4cd77..eabae702a2 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -11,6 +11,8 @@ extern struct setting_parser_info auth_setting_parser_info; extern struct setting_parser_info auth_root_setting_parser_info; +static bool auth_settings_check(void *_set, pool_t pool, const char **error_r); + #undef DEF #define DEF(type, name) \ { type, #name, offsetof(struct auth_passdb_settings, name), NULL } @@ -141,7 +143,7 @@ struct setting_parser_info auth_setting_parser_info = { MEMBER(parent_offset) offsetof(struct auth_settings, root), MEMBER(type_offset) offsetof(struct auth_settings, name), MEMBER(struct_size) sizeof(struct auth_settings), - MEMBER(check_func) NULL + MEMBER(check_func) auth_settings_check }; #undef DEF @@ -173,6 +175,19 @@ struct setting_parser_info auth_root_setting_parser_info = { MEMBER(struct_size) sizeof(struct auth_root_settings) }; +/* */ +static bool auth_settings_check(void *_set, pool_t pool, const char **error_r) +{ + struct auth_settings *set = _set; + + if (set->name == NULL) { + *error_r = "auth section is missing name"; + return FALSE; + } + return TRUE; +} +/* */ + struct auth_settings * auth_settings_read(struct master_service *service, const char *name) {