Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC6601039B for ; Sun, 9 Jun 2013 09:58:28 +0000 (UTC) Received: (qmail 75243 invoked by uid 500); 9 Jun 2013 09:58:28 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 74374 invoked by uid 500); 9 Jun 2013 09:58:26 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 74187 invoked by uid 99); 9 Jun 2013 09:58:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jun 2013 09:58:24 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [188.40.99.202] (HELO eru.sfritsch.de) (188.40.99.202) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jun 2013 09:58:17 +0000 Received: from [10.1.1.6] (helo=k.localnet) by eru.sfritsch.de with esmtp (Exim 4.72) (envelope-from ) id 1UlcNn-00038p-GP; Sun, 09 Jun 2013 11:57:55 +0200 From: Stefan Fritsch To: dev@httpd.apache.org Subject: Revisiting the pre_htaccess hook Date: Sun, 9 Jun 2013 11:57:54 +0200 User-Agent: KMail/1.13.7 (Linux/3.9-1-amd64; KDE/4.8.4; x86_64; ; ) Cc: "Steinar H. Gunderson" , Jeff Trawick MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201306091157.55040.sf@sfritsch.de> X-Virus-Checked: Checked by ClamAV on apache.org Hi, first of all, sorry that it took me so long to review at this. The current pre_access hook is executed before opening the htaccess and then can abort the request with a HTTP error code. Wouldn't a hook for opening the htaccess file make more sense because it would have more possible use cases? Then modules could use this hook to find htaccess files somewhere else, generate/extend/filter them on the fly, etc. For example: apr_status_t ap_run_open_htaccess(request_rec *r, ap_configfile_t *f, const char **full_name, const char *dirname, const char *accessname); The hook would then build full_name (used later for error logging) from dirname and accessname and open it with ap_pcfg_openfile(). Downside would be that the hook cannot provide an arbitrary HTTP status code. Only no error and FORBIDDEN. Would that be a problem? We could add an additional int *request_status parameter, too, though. Or put the error logging/generating of FORBIDDEN into core's open_htaccess hook function and make the hook return HTTP status and not apr_status_t. What do you think? Cheers, Stefan