]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Use ap_canonical_error() where appropriate.
authorBrian Havard <bjh@apache.org>
Thu, 20 Apr 2000 15:20:33 +0000 (15:20 +0000)
committerBrian Havard <bjh@apache.org>
Thu, 20 Apr 2000 15:20:33 +0000 (15:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85000 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_request.c
server/config.c
server/rfc1413.c

index decbb80d6512cf668a3e6dff4193f65552fdd762..8e52484af8ffd8831dfec354c006434ff71a7faa 100644 (file)
@@ -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);
index 03f68dda8e53066f6e9d5eced88a8e6304662bae..9bbc86ef1aaf771cbcb87cd3017287701e7f4a81 100644 (file)
@@ -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;
+            }
         }
     }
 
index 7dbf8252eaa82c5919376104b340e76d50d1ae92..8355038c9b1070b8483ace424e3007f0a13b3d13 100644 (file)
@@ -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;