mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
undid ed5b177691
It is not currently possible to reload only a part of the configuration. If the back-end module changes, the server will bail out instead.
This commit is contained in:
+1
-4
@@ -407,9 +407,6 @@ unsigned force_cert_auth;
|
||||
prev = val;
|
||||
} while((val = optionNextValue(pov, prev)) != NULL);
|
||||
|
||||
/* authentication information is only read on first load, as
|
||||
* it cannot be safely switched */
|
||||
if (reload == 0) {
|
||||
config->sup_config_type = SUP_CONFIG_FILE;
|
||||
|
||||
READ_MULTI_LINE("auth", auth, auth_size);
|
||||
@@ -479,7 +476,6 @@ unsigned force_cert_auth;
|
||||
talloc_free(auth[j]);
|
||||
}
|
||||
talloc_free(auth);
|
||||
}
|
||||
|
||||
/* When adding allocated data, remember to modify
|
||||
* reload_cfg_file();
|
||||
@@ -931,6 +927,7 @@ void print_version(tOptions *opts, tOptDesc *desc)
|
||||
void reload_cfg_file(void *pool, struct cfg_st* config)
|
||||
{
|
||||
clear_cfg_file(config);
|
||||
|
||||
memset(config, 0, sizeof(*config));
|
||||
|
||||
parse_cfg_file(cfg_file, config, 1);
|
||||
|
||||
+12
-2
@@ -53,12 +53,22 @@
|
||||
|
||||
static const struct auth_mod_st *module = NULL;
|
||||
|
||||
void sec_auth_init(void *pool, struct cfg_st *config)
|
||||
void sec_auth_init(sec_mod_st * sec, struct cfg_st *config)
|
||||
{
|
||||
module = get_auth_mod();
|
||||
|
||||
if (module && module->global_init) {
|
||||
module->global_init(pool, config->auth_additional);
|
||||
module->global_init(sec, config->auth_additional);
|
||||
}
|
||||
}
|
||||
|
||||
void sec_auth_reinit(sec_mod_st * sec, struct cfg_st *config)
|
||||
{
|
||||
if (module) {
|
||||
if (module != get_auth_mod()) {
|
||||
seclog(sec, LOG_ERR, "Cannot change authentication method on reload");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ static void check_other_work(sec_mod_st *sec)
|
||||
if (need_reload) {
|
||||
seclog(sec, LOG_DEBUG, "reloading configuration");
|
||||
reload_cfg_file(sec, sec->config);
|
||||
sec_auth_reinit(sec, sec->config);
|
||||
need_reload = 0;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -89,7 +89,8 @@ void cleanup_client_entries(sec_mod_st *sec);
|
||||
}
|
||||
#endif
|
||||
|
||||
void sec_auth_init(void *pool, struct cfg_st *config);
|
||||
void sec_auth_init(sec_mod_st *sec, struct cfg_st *config);
|
||||
void sec_auth_reinit(sec_mod_st *sec, struct cfg_st *config);
|
||||
|
||||
int handle_sec_auth_init(int cfd, sec_mod_st *sec, const SecAuthInitMsg * req);
|
||||
int handle_sec_auth_cont(int cfd, sec_mod_st *sec, const SecAuthContMsg * req);
|
||||
|
||||
Reference in New Issue
Block a user