I also have the pending patch... To prevent typos in the properties no
beeing detected what starting httpd.
Should I include it?
Cheers
Jean-Frederic
Index: apache-1.3/mod_jk.c
===================================================================
--- apache-1.3/mod_jk.c (revision 510645)
+++ apache-1.3/mod_jk.c (working copy)
@@ -2512,8 +2512,8 @@
ap_log_error(APLOG_MARK, APLOG_EMERG, s,
"No worker file and no worker options in httpd.conf "
"use JkWorkerFile to set workers");
- return;
}
+ jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Error in reading worker properties");
}
#if MODULE_MAGIC_NUMBER >= 19980527
Index: common/jk_map.c
===================================================================
--- common/jk_map.c (revision 510645)
+++ common/jk_map.c (working copy)
@@ -365,6 +365,13 @@
trim(v);
if (strlen(v) && strlen(prp)) {
const char *oldv = jk_map_get_string(m, prp, NULL);
+ if (!jk_is_valid_property(prp)) {
+ jk_log(l, JK_LOG_ERROR,
+ "The attribute '%s' is not supported - please check"
+ " the documentation for the supported attributes.",
+ prp);
+ return JK_FALSE;
+ }
if (jk_is_deprecated_property(prp)) {
jk_log(l, JK_LOG_WARNING,
"The attribute '%s' is deprecated - please check"
Index: common/jk_util.c
===================================================================
--- common/jk_util.c (revision 510645)
+++ common/jk_util.c (working copy)
@@ -96,7 +96,9 @@
#define DEFAULT_WORKER JK_AJP13_WORKER_NAME
#define WORKER_LIST_PROPERTY_NAME ("worker.list")
+#define LIST_PROPERTY_NAME ("list")
#define WORKER_MAINTAIN_PROPERTY_NAME ("worker.maintain")
+#define MAINTAIN_PROPERTY_NAME ("maintain")
#define DEFAULT_MAINTAIN_TIME (60)
#define DEFAULT_LB_FACTOR (1)
#define DEFAULT_DISTANCE (0)
@@ -209,6 +211,70 @@
NULL
};
+static const char *supported_properties[] = {
+ SYSPROPS_OF_WORKER,
+ STDERR_OF_WORKER,
+ STDOUT_OF_WORKER,
+ SECRET_OF_WORKER,
+ MX_OF_WORKER,
+ MS_OF_WORKER,
+ CP_OF_WORKER,
+ BRIDGE_OF_WORKER,
+ JVM_OF_WORKER,
+ LIBPATH_OF_WORKER,
+ CMD_LINE_OF_WORKER,
+ NATIVE_LIB_OF_WORKER,
+ HOST_OF_WORKER,
+ PORT_OF_WORKER,
+ TYPE_OF_WORKER,
+ CACHE_OF_WORKER_DEPRECATED,
+ CACHE_OF_WORKER,
+ CACHE_OF_WORKER_MIN,
+ CACHE_TIMEOUT_DEPRECATED,
+ CACHE_TIMEOUT_OF_WORKER,
+ RECOVERY_OPTS_OF_WORKER,
+ CONNECT_TIMEOUT_OF_WORKER,
+ PREPOST_TIMEOUT_OF_WORKER,
+ REPLY_TIMEOUT_OF_WORKER,
+ SOCKET_TIMEOUT_OF_WORKER,
+ SOCKET_BUFFER_OF_WORKER,
+ SOCKET_KEEPALIVE_OF_WORKER,
+ RECYCLE_TIMEOUT_DEPRECATED,
+ LOAD_FACTOR_OF_WORKER,
+ DISTANCE_OF_WORKER,
+ BALANCED_WORKERS_DEPRECATED,
+ BALANCE_WORKERS,
+ STICKY_SESSION,
+ STICKY_SESSION_FORCE,
+ JVM_ROUTE_OF_WORKER_DEPRECATED,
+ ROUTE_OF_WORKER,
+ DOMAIN_OF_WORKER,
+ REDIRECT_OF_WORKER,
+ MOUNT_OF_WORKER,
+ METHOD_OF_WORKER,
+ LOCK_OF_WORKER,
+ IS_WORKER_DISABLED_DEPRECATED,
+ IS_WORKER_STOPPED_DEPRECATED,
+ ACTIVATION_OF_WORKER,
+ WORKER_RECOVER_TIME,
+ WORKER_MAX_PACKET_SIZE,
+ STYLE_SHEET_OF_WORKER,
+ NAMESPACE_OF_WORKER,
+ XML_NAMESPACE_OF_WORKER,
+ XML_DOCTYPE_OF_WORKER,
+ PROP_PREFIX_OF_WORKER,
+ READ_ONLY_OF_WORKER,
+ USER_OF_WORKER,
+ USER_CASE_OF_WORKER,
+ GOOD_RATING_OF_WORKER,
+ BAD_RATING_OF_WORKER,
+ SECRET_KEY_OF_WORKER,
+ RETRIES_OF_WORKER,
+ STATUS_FAIL_OF_WORKER,
+ LIST_PROPERTY_NAME,
+ MAINTAIN_PROPERTY_NAME
+};
+
/* All entries need to have fixed length 8 chars! */
static const char *jk_level_verbs[] = {
"[" JK_LOG_TRACE_VERB "] ",
@@ -1454,6 +1520,37 @@
}
return JK_FALSE;
}
+/*
+ * Check that property is a valid one (to prevent user typos).
+ */
+int jk_is_valid_property(const char *prp_name)
+{
+ const char **props = &list_properties[0];
+ while (*props) {
+ if (jk_is_some_property(prp_name, *props, "."))
+ return JK_TRUE;
+ props++;
+ }
+ props = &unique_properties[0];
+ while (*props) {
+ if (jk_is_some_property(prp_name, *props, "."))
+ return JK_TRUE;
+ props++;
+ }
+ props = &deprecated_properties[0];
+ while (*props) {
+ if (jk_is_some_property(prp_name, *props, "."))
+ return JK_TRUE;
+ props++;
+ }
+ props = &supported_properties[0];
+ while (*props) {
+ if (jk_is_some_property(prp_name, *props, "."))
+ return JK_TRUE;
+ props++;
+ }
+ return JK_FALSE;
+}
int jk_get_worker_stdout(jk_map_t *m, const char *wname, const char **stdout_name)
{
Index: apache-2.0/mod_jk.c
===================================================================
--- apache-2.0/mod_jk.c (revision 510645)
+++ apache-2.0/mod_jk.c (working copy)
@@ -249,7 +249,7 @@
static int JK_METHOD ws_read(jk_ws_service_t *s,
void *b, unsigned len, unsigned *actually_read);
-static void init_jk(apr_pool_t * pconf, jk_server_conf_t * conf,
+static int init_jk(apr_pool_t * pconf, jk_server_conf_t * conf,
server_rec * s);
static int JK_METHOD ws_write(jk_ws_service_t *s, const void *b, unsigned l);
@@ -2577,7 +2577,7 @@
SetHandler and normal apache directives ( but minimal jk-specific
stuff )
*/
-static void init_jk(apr_pool_t * pconf, jk_server_conf_t * conf,
+static int init_jk(apr_pool_t * pconf, jk_server_conf_t * conf,
server_rec * s)
{
int rc;
@@ -2633,12 +2633,14 @@
0, NULL,
"No worker file and no worker options in httpd.conf"
"use JkWorkerFile to set workers");
- return;
}
+ ap_log_error(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, 0, NULL, "Error in reading worker properties");
+ return !OK;
}
if (jk_map_resolve_references(init_map, "worker.", 1, 1, conf->log) == JK_FALSE) {
- jk_error_exit(APLOG_MARK, APLOG_EMERG, s, pconf, "Error in resolving configuration references");
+ ap_log_error(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, 0, NULL, "Error in resolving configuration references");
+ return !OK;
}
/* we add the URI->WORKER MAP since workers using AJP14
@@ -2653,6 +2655,7 @@
if (wc_open(init_map, &worker_env, conf->log)) {
ap_add_version_component(pconf, JK_EXPOSED_VERSION);
}
+ return OK;
}
static int jk_post_config(apr_pool_t * pconf,
@@ -2670,7 +2673,7 @@
pconf)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
"mod_jk: could not create jk_log_lock");
- return HTTP_INTERNAL_SERVER_ERROR;
+ return !OK;
}
#if JK_NEED_SET_MUTEX_PERMS
@@ -2679,7 +2682,7 @@
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
"mod_jk: Could not set permissions on "
"jk_log_lock; check User and Group directives");
- return HTTP_INTERNAL_SERVER_ERROR;
+ return !OK;
}
#endif
@@ -2697,7 +2700,7 @@
jk_server_conf_t *sconf = (jk_server_conf_t *)ap_get_module_config(srv->module_config,
&jk_module);
if (open_jklog(srv, pconf))
- return HTTP_INTERNAL_SERVER_ERROR;
+ return !OK;
if (sconf) {
if (!uri_worker_map_alloc(&(sconf->uw_map),
sconf->uri_to_context, sconf->log))
@@ -2745,7 +2748,8 @@
}
}
}
- init_jk(pconf, conf, s);
+ if (init_jk(pconf, conf, s))
+ return !OK;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]