allowdeny *a;
char *where = apr_pstrdup(cmd->pool, where_c);
char *s;
- char msgbuf[120];
apr_status_t rv;
if (strcasecmp(from, "from"))
return "An IP address was expected";
}
else if (rv != APR_SUCCESS) {
- apr_strerror(rv, msgbuf, sizeof msgbuf);
- return apr_pstrdup(cmd->pool, msgbuf);
+ return apr_psprintf(cmd->pool, "%pm", &rv);
}
a->type = T_IP;
}
else if (!APR_STATUS_IS_EINVAL(rv = apr_ipsubnet_create(&a->x.ip, where,
NULL, cmd->pool))) {
- if (rv != APR_SUCCESS) {
- apr_strerror(rv, msgbuf, sizeof msgbuf);
- return apr_pstrdup(cmd->pool, msgbuf);
- }
+ if (rv != APR_SUCCESS)
+ return apr_psprintf(cmd->pool, "%pm", &rv);
a->type = T_IP;
}
+ else if (ap_strchr(where, '#')) {
+ return "No comments are allowed here";
+ }
else { /* no slash, didn't look like an IP address => must be a host */
a->type = T_HOST;
}
return 1;
case T_IP:
- if (apr_ipsubnet_test(ap[i].x.ip, r->connection->remote_addr)) {
+ if (apr_ipsubnet_test(ap[i].x.ip, r->useragent_addr)) {
return 1;
}
break;
if (!gothost) {
int remotehost_is_ip;
- remotehost = ap_get_remote_host(r->connection,
- r->per_dir_config,
- REMOTE_DOUBLE_REV,
- &remotehost_is_ip);
+ remotehost = ap_get_useragent_host(r, REMOTE_DOUBLE_REV,
+ &remotehost_is_ip);
if ((remotehost == NULL) || remotehost_is_ip) {
gothost = 1;
}
if (ret == HTTP_FORBIDDEN) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01797)
"client denied by server configuration: %s%s",
r->filename ? "" : "uri ",
r->filename ? r->filename : r->uri);
AP_AUTH_INTERNAL_PER_CONF);
}
-module AP_MODULE_DECLARE_DATA access_compat_module =
+AP_DECLARE_MODULE(access_compat) =
{
STANDARD20_MODULE_STUFF,
create_access_compat_dir_config, /* dir config creater */