APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *authz_ap_some_auth_required;
+/* Insist that at least one module will undertake to provide system
+ * security by dropping startup privileges.
+ */
+static int sys_privileges = 0;
+AP_DECLARE(int) sys_privileges_handlers(int inc)
+{
+ sys_privileges += inc;
+ return sys_privileges;
+}
static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
logio_add_bytes_out = APR_RETRIEVE_OPTIONAL_FN(ap_logio_add_bytes_out);
set_banner(pconf);
ap_setup_make_content_type(pconf);
ap_setup_auth_internal(ptemp);
+ if (!sys_privileges) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
+ "Server MUST relinquish startup privileges before "
+ "accepting connections. Please ensure mod_unixd "
+ "or other system security module is loaded.");
+ return !OK;
+ }
return OK;
}
return DONE;
}
-/* Insist that at least one module will undertake to provide system
- * security by dropping startup privileges.
- */
-static int sys_privileges = 0;
-AP_DECLARE(int) sys_privileges_handlers(int inc)
-{
- sys_privileges += inc;
- return sys_privileges;
-}
-static int core_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
-{
- if (!sys_privileges) {
- ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
- "Server MUST relinquish startup privileges before "
- "accepting connections. Please ensure mod_unixd "
- "or other system security module is loaded.");
- return !OK;
- }
- return OK;
-}
-
static void register_hooks(apr_pool_t *p)
{
/* create_connection and install_transport_filters are
ap_hook_pre_connection(core_pre_connection, NULL, NULL,
APR_HOOK_REALLY_LAST);
- ap_hook_pre_config(core_pre_config,NULL,NULL,APR_HOOK_LAST);
ap_hook_post_config(core_post_config,NULL,NULL,APR_HOOK_REALLY_FIRST);
ap_hook_translate_name(ap_core_translate,NULL,NULL,APR_HOOK_REALLY_LAST);
ap_hook_map_to_storage(core_map_to_storage,NULL,NULL,APR_HOOK_REALLY_LAST);