static char *server_banner = NULL;
static int banner_locked = 0;
static char *server_description = NULL;
+static char *user_server_banner = NULL;
enum server_token_type {
SrvTk_MAJOR, /* eg: Apache/2 */
SrvTk_OS, /* eg: Apache/2.0.41 (UNIX) */
SrvTk_FULL, /* eg: Apache/2.0.41 (UNIX) PHP/4.2.2 FooBar/1.2b */
SrvTk_PRODUCT_ONLY, /* eg: Apache */
- SrvTk_OFF /* eg: <blank> */
+ SrvTk_OFF, /* eg: <blank> */
+ SrvTk_SET
};
static enum server_token_type ap_server_tokens = SrvTk_FULL;
*/
static void set_banner(apr_pool_t *pconf)
{
- if (ap_server_tokens == SrvTk_OFF) {
+ if (ap_server_tokens == SrvTk_SET) {
+ ap_add_version_component(pconf, user_server_banner);
+ }
+ else if (ap_server_tokens == SrvTk_OFF) {
ap_add_version_component(pconf, "");
}
else if (ap_server_tokens == SrvTk_PRODUCT_ONLY) {
}
static const char *set_serv_tokens(cmd_parms *cmd, void *dummy,
- const char *arg)
+ const char *arg1, const char *arg2)
{
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
return err;
}
- if (!strcasecmp(arg, "Off")) {
+ if (!strcasecmp(arg1, "Set")) {
+ ap_server_tokens = SrvTk_SET;
+ user_server_banner = (arg2 ? apr_pstrdup(cmd->pool, arg2) : "");
+ }
+ else if (!strcasecmp(arg1, "Off")) {
ap_server_tokens = SrvTk_OFF;
}
- else if (!strcasecmp(arg, "OS")) {
+ else if (!strcasecmp(arg1, "OS")) {
ap_server_tokens = SrvTk_OS;
}
- else if (!strcasecmp(arg, "Min") || !strcasecmp(arg, "Minimal")) {
+ else if (!strcasecmp(arg1, "Min") || !strcasecmp(arg1, "Minimal")) {
ap_server_tokens = SrvTk_MINIMAL;
}
- else if (!strcasecmp(arg, "Major")) {
+ else if (!strcasecmp(arg1, "Major")) {
ap_server_tokens = SrvTk_MAJOR;
}
- else if (!strcasecmp(arg, "Minor") ) {
+ else if (!strcasecmp(arg1, "Minor") ) {
ap_server_tokens = SrvTk_MINOR;
}
- else if (!strcasecmp(arg, "Prod") || !strcasecmp(arg, "ProductOnly")) {
+ else if (!strcasecmp(arg1, "Prod") || !strcasecmp(arg1, "ProductOnly")) {
ap_server_tokens = SrvTk_PRODUCT_ONLY;
}
else {
"Level of verbosity in error logging"),
AP_INIT_TAKE1("NameVirtualHost", ap_set_name_virtual_host, NULL, RSRC_CONF,
"A numeric IP address:port, or the name of a host"),
-AP_INIT_TAKE1("ServerTokens", set_serv_tokens, NULL, RSRC_CONF,
- "Determine tokens displayed in the Server: header - Min(imal), Major, Minor, Prod, OS, Off or Full"),
+AP_INIT_TAKE12("ServerTokens", set_serv_tokens, NULL, RSRC_CONF,
+ "Determine tokens displayed in the Server: header - Min(imal), "
+ "Major, Minor, Prod, OS, Off, Set or Full"),
AP_INIT_TAKE1("LimitRequestLine", set_limit_req_line, NULL, RSRC_CONF,
"Limit on maximum size of an HTTP request line"),
AP_INIT_TAKE1("LimitRequestFieldsize", set_limit_req_fieldsize, NULL,