library: Return FALSE from library_init() if loaded settings are invalid

This way daemons won't start with config files that contain errors.
This commit is contained in:
Tobias Brunner
2018-09-11 18:30:18 +02:00
parent 71dca60c31
commit f6b4ba2a65
2 changed files with 18 additions and 10 deletions
+4 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2016 Tobias Brunner
* Copyright (C) 2010-2018 Tobias Brunner
* Copyright (C) 2008 Martin Willi
* HSR Hochschule fuer Technik Rapperswil
*
@@ -258,11 +258,12 @@ struct library_t {
*
* The settings and namespace arguments are only used on the first call.
*
* @param settings file to read settings from, may be NULL for default
* @param settings file to read settings from, may be NULL for default or
* "" to not load any settings
* @param namespace name of the binary that uses the library, determines
* the first section name when reading config options.
* Defaults to libstrongswan if NULL.
* @return FALSE if integrity check failed
* @return FALSE if integrity check failed or settings are invalid
*/
bool library_init(char *settings, const char *namespace);