exception hooks to be called (in addition to the build time
requirements).
The 2.1-dev feature is now more aligned with the 1.3.30-dev feature,
in that there is a build-time requirement as well as a configuration
requirement.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102686
13f79535-47bb-0310-9956-
ffa450edef68
directory, display the MPM name and some MPM properties.
[Geoffrey Young <geoff apache.org>]
- *) Add fatal exception hook for use by debug modules. The hook is only
- available if the --enable-exception-hook configure parm is used.
- [Jeff Trawick]
+ *) Add fatal exception hook for use by diagnostic modules. The hook
+ is only available if the --enable-exception-hook configure parm
+ is used and the EnableExceptionHook directive has been set to
+ "on". [Jeff Trawick]
*) mod_ssl/mod_status: Re-enable support for output of SSL session
cache information in server-status page. [Joe Orton]
extern apr_status_t ap_fatal_signal_child_setup(server_rec *s);
#endif
+#if AP_ENABLE_EXCEPTION_HOOK
+extern const char *ap_mpm_set_exception_hook(cmd_parms *cmd, void *dummy,
+ const char *arg);
+#endif
+
#ifdef __cplusplus
}
#endif
AP_INIT_TAKE1("MaxMemFree", ap_mpm_set_max_mem_free, NULL, RSRC_CONF,
"Maximum number of 1k blocks a particular childs allocator may hold."),
#endif
+#if AP_ENABLE_EXCEPTION_HOOK
+AP_INIT_TAKE1("EnableExceptionHook", ap_mpm_set_exception_hook, NULL, RSRC_CONF,
+ "Controls whether exception hook may be called after a crash"),
+#endif
{ NULL }
};
apr_pool_t *pconf;
#if AP_ENABLE_EXCEPTION_HOOK
+
+static int exception_hook_enabled;
+
+const char *ap_mpm_set_exception_hook(cmd_parms *cmd, void *dummy,
+ const char *arg)
+{
+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+ if (err != NULL) {
+ return err;
+ }
+
+ if (cmd->server->is_virtual) {
+ return "EnableExceptionHook directive not allowed in <VirtualHost>";
+ }
+
+ if (strcasecmp(arg, "on") == 0) {
+ exception_hook_enabled = 1;
+ }
+ else if (strcasecmp(arg, "off") == 0) {
+ exception_hook_enabled = 0;
+ }
+ else {
+ return "parameter must be 'on' or 'off'";
+ }
+
+ return NULL;
+}
+
APR_HOOK_STRUCT(
APR_HOOK_LINK(fatal_exception)
)
{
ap_exception_info_t ei = {0};
- if (geteuid() != 0 &&
+ if (exception_hook_enabled &&
+ geteuid() != 0 &&
my_pid != parent_pid) {
ei.sig = sig;
ei.pid = my_pid;