Changes with Apache 2.3.10
+ *) core: Fail startup when the argument to ServerName looks like a glob
+ or a regular expression instead of a hostname (*?[]). PR 39863
+ [Rahul Nair <rahul.g.nair gmail.com>]
+
*) mod_userdir: Add merging of enable, disable, and filename arguments
to UserDir directive, leaving enable/disable of userlists unmerged.
PR 44076 [Eric Covener]
return NULL;
}
+
+static const apr_status_t valid_hostname(const char* name)
+{
+ if (ap_strchr_c(name, '*') || ap_strchr_c(name, '?') ||
+ ap_strchr_c(name, '[') || ap_strchr_c(name, ']')) {
+ return APR_EINVAL;
+ }
+ return APR_SUCCESS;
+}
/*
* The ServerName directive takes one argument with format
* [scheme://]fully-qualified-domain-name[:port], for instance
return err;
}
+ if (valid_hostname(arg) != APR_SUCCESS)
+ return apr_pstrcat(cmd->temp_pool, "Invalid ServerName \"", arg,
+ "\" use ServerAlias to set multiple server names.", NULL);
+
part = ap_strstr_c(arg, "://");
if (part) {