strcasecmp \
strncasecmp \
strstr \
-strerror \
initgroups \
waitpid \
memmove \
invalid_pw = ap_validate_password(sent_pw, real_pw);
if (invalid_pw != APR_SUCCESS) {
-#ifdef HAVE_APR_STRERROR
+ char buf[120]
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
"DB user %s: authentication failure for \"%s\": %s",
- r->user, r->uri, apr_strerror(invalid_pw));
-#else
- ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
- "DB user %s: authentication failure for \"%s\": %d",
- r->user, r->uri, "error number",
- invalid_pw);
-#endif
+ r->user, r->uri, ap_strerror(invalid_pw, buf, sizeof(buf)));
ap_note_basic_auth_failure(r);
return AUTH_REQUIRED;
}
status = ap_generate_random_bytes(secret, sizeof(secret));
if(!(status == APR_SUCCESS)) {
+ char buf[120];
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0, s,
"Digest: error generating secret: %s",
- /*ap_strerror(status)*/ "need ap_strerror here");
+ ap_strerror(status, buf, sizeof(buf)));
exit(1);
}
j++;
}
if (i == -1) {
+ char buf[120];
ap_pclosesocket(r->pool, sock);
return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, ap_pstrcat(r->pool,
"Could not connect to remote machine:<br>",
- strerror(errno), NULL));
+ ap_strerror(errno, buf, sizeof(buf)),
+ NULL));
}
/* If we are connecting through a remote proxy, we need to pass
}
#endif
if (i == -1) {
+ char buf[120];
ap_pclosesocket(p, sock);
return ap_proxyerror(r, HTTP_BAD_GATEWAY, ap_pstrcat(r->pool,
"Could not connect to remote machine: ",
- strerror(errno), NULL));
+ ap_strerror(errno, buf, sizeof(buf)), NULL));
}
f = ap_bcreate(p, B_RDWR | B_SOCKET);
i = ap_proxy_doconnect(dsock, &data_addr, r);
if (i == -1) {
+ char buf[120];
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
ap_pstrcat(r->pool,
"Could not connect to remote machine: ",
- strerror(errno), NULL));
+ ap_strerror(errno, buf,
+ sizeof(buf)), NULL));
}
else {
pasvmode = 1;
if (proxyhost != NULL)
return DECLINED; /* try again another way */
else
+ char buf[120];
return ap_proxyerror(r, HTTP_BAD_GATEWAY, ap_pstrcat(r->pool,
"Could not connect to remote machine: ",
- strerror(errno), NULL));
+ ap_strerror(errno, buf, sizeof(buf)), NULL));
}
clear_connection(r->pool, r->headers_in); /* Strip connection-based headers */
/* close out the standard file descriptors */
if (freopen("/dev/null", "r", stdin) == NULL) {
+ char buf[120];
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"%s: unable to replace stdin with /dev/null: %s",
- ap_server_argv0, strerror(errno));
+ ap_server_argv0, ap_strerror(errno, buf, sizeof(buf)));
/* continue anyhow -- note we can't close out descriptor 0 because we
* have nothing to replace it with, and if we didn't have a descriptor
* 0 the next file would be created with that value ... leading to
*/
}
if (freopen("/dev/null", "w", stdout) == NULL) {
+ char buf[120];
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"%s: unable to replace stdout with /dev/null: %s",
- ap_server_argv0, strerror(errno));
+ ap_server_argv0, ap_strerror(errno, buf, sizeof(buf)));
}
/* stderr is a tricky one, we really want it to be the error_log,
* but we haven't opened that yet. So leave it alone for now and it'll
/* close out the standard file descriptors */
if (freopen("/dev/null", "r", stdin) == NULL) {
+ char buf[120];
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"%s: unable to replace stdin with /dev/null: %s",
- ap_server_argv0, strerror(errno));
+ ap_server_argv0, ap_strerror(errno, buf, sizeof(buf)));
/* continue anyhow -- note we can't close out descriptor 0 because we
* have nothing to replace it with, and if we didn't have a descriptor
* 0 the next file would be created with that value ... leading to
*/
}
if (freopen("/dev/null", "w", stdout) == NULL) {
+ char buf[120];
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"%s: unable to replace stdout with /dev/null: %s",
- ap_server_argv0, strerror(errno));
+ ap_server_argv0, ap_strerror(errno, buf, sizeof(buf)));
}
/* stderr is a tricky one, we really want it to be the error_log,
* but we haven't opened that yet. So leave it alone for now and it'll
#define HAVE_MEMMOVE
#define HAVE_STRCASECMP
#define HAVE_STRNCASECMP
-#define HAVE_STRERROR
#define HAVE_STRDUP
#define HAVE_STRSTR
int rc;
ap_procattr_t *procattr;
ap_proc_t procnew;
+ ap_status_t status;
#ifdef SIGHUP
ap_signal(SIGHUP, SIG_IGN);
#endif
- if ((ap_createprocattr_init(&procattr, pl->p) != APR_SUCCESS) ||
- (ap_setprocattr_childin(procattr, ap_piped_log_read_fd(pl),
- ap_piped_log_write_fd(pl)) != APR_SUCCESS)) {
+ if (((status = ap_createprocattr_init(&procattr, pl->p)) != APR_SUCCESS) ||
+ ((status = ap_setprocattr_childin(procattr, ap_piped_log_read_fd(pl),
+ ap_piped_log_write_fd(pl))) != APR_SUCCESS)) {
+ char buf[120];
/* Something bad happened, give up and go away. */
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
- "piped_log_spawn: unable to exec '%s': %s",
- pl->program, strerror (errno));
+ "piped_log_spawn: unable to setup child process '%s': %s",
+ pl->program, ap_strerror(status, buf, sizeof(buf)));
rc = -1;
}
else {
static void piped_log_maintenance(int reason, void *data, ap_wait_t status)
{
piped_log *pl = data;
+ ap_status_t stats;
switch (reason) {
case APR_OC_REASON_DEATH:
/* during a restart */
break;
}
- if (piped_log_spawn(pl) != APR_SUCCESS) {
+ if ((stats = piped_log_spawn(pl)) != APR_SUCCESS) {
/* what can we do? This could be the error log we're having
* problems opening up... */
+ char buf[120];
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
"piped_log_maintenance: unable to respawn '%s': %s",
- pl->program, strerror(errno));
+ pl->program, ap_strerror(stats, buf, sizeof(buf)));
}
break;
configfile_t *new_cfg;
ap_file_t *file = NULL;
ap_finfo_t finfo;
- ap_status_t stat;
+ ap_status_t status;
+#ifdef DEBUG
+ char buf[120];
+#endif
if (name == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL,
return APR_EACCES;
}
- stat = ap_open(&file, name, APR_READ, APR_OS_DEFAULT, p);
+ status = ap_open(&file, name, APR_READ, APR_OS_DEFAULT, p);
#ifdef DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
"Opening config file %s (%s)",
- name, (stat != APR_SUCCESS) ? strerror(errno) : "successful");
+ name, (status != APR_SUCCESS) ?
+ ap_strerror(status, buf, sizeof(buf)) : "successful");
#endif
- if (stat != APR_SUCCESS)
- return stat;
+ if (status != APR_SUCCESS)
+ return status;
- stat = ap_getfileinfo(&finfo, file);
- if (stat != APR_SUCCESS)
- return stat;
+ status = ap_getfileinfo(&finfo, file);
+ if (status != APR_SUCCESS)
+ return status;
if (finfo.filetype != APR_REG &&
#if defined(WIN32) || defined(OS2)
return ap_pbase64encode(p, string);
}
-#ifndef HAVE_STRERROR
-char *
- strerror(int err)
-{
-
- char *p;
- extern char *const sys_errlist[];
-
- p = sys_errlist[err];
- return (p);
-}
-#endif
-
/* we want to downcase the type/subtype for comparison purposes
* but nothing else because ;parameter=foo values are case sensitive.
* XXX: in truth we want to downcase parameter names... but really,
struct group *gr; /* group entry holder */
struct stat dir_info; /* directory info holder */
struct stat prg_info; /* program info holder */
+ char buf[120];
/*
* If there are a proper number of arguments, set
{
case -1: /* Error */
log_err("failed to setup bs2000 environment for user %s: %s\n",
- target_uname, strerror(errno));
+ target_uname, ap_strerror(errno, buf, sizeof(buf)));
exit(150);
case 0: /* Child */
break;
*
* Oh well, log the failure and error out.
*/
- log_err("(%d)%s: exec failed (%s)\n", errno, strerror(errno), cmd);
+ log_err("(%d)%s: exec failed (%s)\n", errno,
+ ap_strerror(errno, buf, sizeof(buf)), cmd);
exit(255);
}