Received: (from majordom@localhost) by hyperreal.org (8.8.5/8.8.5) id PAA23435; Sat, 23 Aug 1997 15:50:24 -0700 (PDT) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by hyperreal.org (8.8.5/8.8.5) with ESMTP id PAA23430 for ; Sat, 23 Aug 1997 15:50:19 -0700 (PDT) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.5/8.8.5) with UUCP id QAA00239 for new-httpd@apache.org; Sat, 23 Aug 1997 16:50:18 -0600 (MDT) Received: from localhost (marcs@localhost) by alive.znep.com (8.7.5/8.7.3) with SMTP id QAA17280 for ; Sat, 23 Aug 1997 16:44:29 -0600 (MDT) Date: Sat, 23 Aug 1997 16:44:28 -0600 (MDT) From: Marc Slemko To: TLOSAP Subject: [PATCH] unreadable .htaccess Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Reposted; minor change since the first posting by adding ENOTDIR. I'm interested in if people think HTTP_FORBIDDEN or HTTP_INTERNAL_SERVER_ERROR is the more appropriate. My view is that part of the resource is how the .htaccess file says it should be presented, so if we can't read the .htaccess we can't read part of the resource so forbidden is appropriate. If you do server error, then the following situation: $ mkdir ~/public_html/dir $ chmod 700 !$ $ lynx http://localhost/~user/dir/ will give a server error, which is counterintuitive in some ways. The current interpretation of forbidden does not just apply to the final file. In any case, I could go for either so majority feedback probably wins. Index: http_config.c =================================================================== RCS file: /export/home/cvs/apachen/src/main/http_config.c,v retrieving revision 1.74 diff -u -r1.74 http_config.c --- http_config.c 1997/08/23 04:00:27 1.74 +++ http_config.c 1997/08/23 22:38:26 @@ -952,8 +952,15 @@ } *result = dc; - } else - dc = NULL; + } else { + if (errno == ENOENT || errno == ENOTDIR) + dc = NULL; + else { + log_unixerr("pfopen", filename, + "unable to check for htaccess file", r->server); + return HTTP_FORBIDDEN; + } + } /* cache it */ new = palloc(r->pool, sizeof(struct htaccess_result));