From: Brian Havard Date: Thu, 20 Apr 2000 15:20:33 +0000 (+0000) Subject: Use ap_canonical_error() where appropriate. X-Git-Tag: apache-doc-split-01~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5b782f5b8a92408955cdedcf7741f39aa913576;p=thirdparty%2Fapache%2Fhttpd.git Use ap_canonical_error() where appropriate. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85000 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_request.c b/modules/http/http_request.c index decbb80d651..8e52484af8f 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -195,7 +195,7 @@ static int get_path_info(request_rec *r) 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 @@ -286,9 +286,10 @@ static int get_path_info(request_rec *r) * 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 != '/') @@ -299,7 +300,7 @@ static int get_path_info(request_rec *r) } 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); diff --git a/server/config.c b/server/config.c index 03f68dda8e5..9bbc86ef1aa 100644 --- a/server/config.c +++ b/server/config.c @@ -1147,16 +1147,19 @@ int ap_parse_htaccess(void **result, request_rec *r, int override, } *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; + } } } diff --git a/server/rfc1413.c b/server/rfc1413.c index 7dbf8252eaa..8355038c9b1 100644 --- a/server/rfc1413.c +++ b/server/rfc1413.c @@ -160,7 +160,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip, 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; @@ -186,7 +186,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip, 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;