char *path = r->filename;
char *end = &path[strlen(path)];
char *last_cp = NULL;
- int rv;
+ int rv, rvc;
#ifdef HAVE_DRIVE_LETTERS
char bStripSlash=1;
#endif
* even if they returned an error.
*/
r->finfo.protection = 0;
+ rvc = ap_canonical_error(rv);
#if defined(APR_ENOENT) && defined(APR_ENOTDIR)
- if (rv == APR_ENOENT || rv == APR_ENOTDIR) {
+ if (rvc == APR_ENOENT || rvc == APR_ENOTDIR) {
last_cp = cp;
while (--cp > path && *cp != '/')
}
else {
#if defined(APR_EACCES)
- if (rv != APR_EACCES)
+ if (rvc != APR_EACCES)
#endif
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"access to %s failed", r->uri);
}
*result = dc;
break;
- }
- else if (status != APR_ENOENT && status != APR_ENOTDIR) {
- ap_log_rerror(APLOG_MARK, APLOG_CRIT, errno, r,
- "%s pcfg_openfile: unable to check htaccess file, "
- "ensure it is readable",
- filename);
- ap_table_setn(r->notes, "error-notes",
- "Server unable to read htaccess file, denying "
- "access to be safe");
- return HTTP_FORBIDDEN;
+ } else {
+ ap_status_t cerr = ap_canonical_error(status);
+
+ if (cerr != APR_ENOENT && cerr != APR_ENOTDIR) {
+ ap_log_rerror(APLOG_MARK, APLOG_CRIT, status, r,
+ "%s pcfg_openfile: unable to check htaccess file, "
+ "ensure it is readable",
+ filename);
+ ap_table_setn(r->notes, "error-notes",
+ "Server unable to read htaccess file, denying "
+ "access to be safe");
+ return HTTP_FORBIDDEN;
+ }
}
}
ap_ssize_t j = strlen(buffer + i);
ap_status_t status;
status = ap_send(sock, buffer+i, &j);
- if (status != APR_SUCCESS && status != APR_EINTR) {
+ if (status != APR_SUCCESS && ap_canonical_error(status) != APR_EINTR) {
ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
"write: rfc1413: error sending request");
return -1;
ap_ssize_t j = sizeof(buffer) - 1 - i;
ap_status_t status;
status = ap_recv(sock, buffer+i, &j);
- if (status != APR_SUCCESS && status != APR_EINTR) {
+ if (status != APR_SUCCESS && ap_canonical_error(status) != APR_EINTR) {
ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
"read: rfc1413: error reading response");
return -1;