Skip to content
Snippets Groups Projects
Commit 8d53d75a authored by Robert Edmonds's avatar Robert Edmonds Committed by Robert Edmonds
Browse files

knotd: Make global query module activation occur later

This commit moves the call to conf_activate_modules() out of the
set_config() function and into main() so that global query modules are
activated after privilege dropping has occurred.

This makes the global query modules match the zone query modules a
little better. The zone query modules are activated later, after
privilege dropping has occurred.

This ensures that if a global query module launches its own threads at
startup, those threads are spawned from a main thread that has already
performed privilege dropping.
parent 99e9ce87
No related branches found
No related tags found
1 merge request!864Linux capabilities rewrite
......@@ -367,10 +367,6 @@ static int set_config(const char *confdb, const char *config)
log_error("failed to migrate configuration (%s)", knot_strerror(ret));
}
/* Activate global query modules. */
conf_activate_modules(new_conf, NULL, new_conf->query_modules,
&new_conf->query_plan);
/* Update to the new config. */
conf_update(new_conf, CONF_UPD_FNONE);
......@@ -534,6 +530,10 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
/* Activate global query modules. */
conf_activate_modules(conf(), NULL, conf()->query_modules,
&conf()->query_plan);
/* Check and create PID file. */
long pid = (long)getpid();
if (daemonize) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment