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 { /* no slash, didn't look like an IP address => must be a host */
request_rec *r;
void *vr;
apr_file_t *stderr_log;
- char errbuf[200];
char time_str[APR_CTIME_LEN];
apr_pool_userdata_get(&vr, ERRFN_USERDATA_KEY, pool);
apr_file_open_stderr(&stderr_log, pool);
ap_recent_ctime(time_str, apr_time_now());
apr_file_printf(stderr_log,
- "[%s] [client %s] mod_ext_filter (%d)%s: %s\n",
+ "[%s] [client %s] mod_ext_filter (%d)%pm: %s\n",
time_str,
r->useragent_ip,
err,
- apr_strerror(err, errbuf, sizeof(errbuf)),
+ &err,
description);
}
const char *description)
{
apr_file_t *stderr_log;
- char errbuf[200];
apr_file_open_stderr(&stderr_log, pool);
/* Escape the logged string because it may be something that
* came in over the network.
*/
apr_file_printf(stderr_log,
- "(%d)%s: %s\n",
+ "(%d)%pm: %s\n",
err,
- apr_strerror(err, errbuf, sizeof(errbuf)),
+ &err,
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
ap_escape_logitem(pool,
#endif
}
if (rv != APR_SUCCESS) {
- char msgbuf[128];
- apr_strerror(rv, msgbuf, sizeof(msgbuf));
- return apr_pstrcat(cmd->pool, "RemoteIP: Error parsing IP ", arg,
- " (", msgbuf, " error) for ", cmd->cmd->name, NULL);
+ return apr_psprintf(cmd->pool,
+ "RemoteIP: Error parsing IP %s (%pm error) for %s",
+ arg, &rv, cmd->cmd->name);
}
return NULL;
filename = ap_server_root_relative(cmd->temp_pool, filename);
rv = ap_pcfg_openfile(&cfp, cmd->temp_pool, filename);
if (rv != APR_SUCCESS) {
- return apr_psprintf(cmd->pool, "%s: Could not open file %s: %s",
- cmd->cmd->name, filename,
- apr_strerror(rv, lbuf, sizeof(lbuf)));
+ return apr_psprintf(cmd->pool, "%s: Could not open file %s: %pm",
+ cmd->cmd->name, filename, &rv);
}
while (!(ap_cfg_getline(lbuf, MAX_STRING_LEN, cfp))) {
filename = ap_server_root_relative(cmd->temp_pool, filename);
rv = ap_pcfg_openfile(&file, cmd->temp_pool, filename);
if (rv != APR_SUCCESS) {
- return apr_psprintf(cmd->pool, "%s: Could not open file %s: %s",
- cmd->cmd->name, filename,
- apr_strerror(rv, buffer, sizeof(buffer)));
+ return apr_psprintf(cmd->pool, "%s: Could not open file %s: %pm",
+ cmd->cmd->name, filename, &rv);
}
while (!(ap_cfg_getline(buffer, sizeof(buffer), file))) {
rv = ap_pcfg_openfile(&cfp, p, fname);
if (rv != APR_SUCCESS) {
- char errmsg[120];
- return apr_psprintf(p, "Could not open configuration file %s: %s",
- fname, apr_strerror(rv, errmsg, sizeof errmsg));
+ return apr_psprintf(p, "Could not open configuration file %s: %pm",
+ fname, &rv);
}
parms.config_file = cfp;
*/
rv = apr_dir_open(&dirp, path, ptemp);
if (rv != APR_SUCCESS) {
- char errmsg[120];
- return apr_psprintf(p, "Could not open config directory %s: %s",
- path, apr_strerror(rv, errmsg, sizeof errmsg));
+ return apr_psprintf(p, "Could not open config directory %s: %pm",
+ path, &rv);
}
candidates = apr_array_make(ptemp, 1, sizeof(fnames));
*/
rv = apr_dir_open(&dirp, path, ptemp);
if (rv != APR_SUCCESS) {
- char errmsg[120];
- return apr_psprintf(p, "Could not open config directory %s: %s",
- path, apr_strerror(rv, errmsg, sizeof errmsg));
+ return apr_psprintf(p, "Could not open config directory %s: %pm",
+ path, &rv);
}
candidates = apr_array_make(ptemp, 1, sizeof(fnames));