# HG changeset patch # User Timo Sirainen # Date 1242086919 14400 # Node ID 5e80d667a827bfe3e3613a03848928bbbf487845 # Parent 36bdeba8f39a24f72cc03a04df9e8c7650e01cb1 auth settings: Make sure we have a section name defined. diff -r 36bdeba8f39a -r 5e80d667a827 src/auth/auth-settings.c --- a/src/auth/auth-settings.c Mon May 11 19:28:42 2009 -0400 +++ b/src/auth/auth-settings.c Mon May 11 20:08:39 2009 -0400 @@ -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 @@ 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 @@ 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) {