Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 79021 invoked from network); 14 Aug 2008 18:42:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Aug 2008 18:42:38 -0000 Received: (qmail 4336 invoked by uid 500); 14 Aug 2008 18:42:36 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 4017 invoked by uid 500); 14 Aug 2008 18:42:36 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 4006 invoked by uid 99); 14 Aug 2008 18:42:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2008 11:42:36 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.6.21] (HELO gmp-eb-inf-1.sun.com) (192.18.6.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2008 18:41:38 +0000 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10]) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m7EIfxEC000691 for ; Thu, 14 Aug 2008 18:42:00 GMT Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K5L00M01T9O4N00@fe-emea-10.sun.com> (original mail from Vasiliy.Baranov@Sun.COM) for modules-dev@httpd.apache.org; Thu, 14 Aug 2008 19:41:59 +0100 (BST) Received: from [129.159.127.193] by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K5L00IPTT9ZEU10@fe-emea-10.sun.com> for modules-dev@httpd.apache.org; Thu, 14 Aug 2008 19:41:59 +0100 (BST) Date: Thu, 14 Aug 2008 22:41:51 +0400 From: Vasiliy Baranov Subject: request_rec.filename alteration Sender: Vasiliy.Baranov@Sun.COM To: modules-dev@httpd.apache.org Message-id: <48A47C6F.9010603@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am trying to write a module that internally translates "/foo/bar/XXX/..." in document paths to "/foo/bar/YYY/...", where "/foo/bar" is a constant and YYY is a function of "/foo/bar" contents on disk _and_ authenticated user name. Since the translate_name phase precedes check_user_id (authentication) phase, doing my translation in a translate_name hook is out of question. On the other hand, when I am in a fixups hook, I am able to alter request_rec.filename as needed, but then someone, most likely core.c line 3631 (httpd 2.2.9), notices that the original document (in "/foo/bar/XXX/...") does not exist, and issues FILE_NOT_FOUND. What would be the right way to approach this? Doing this stuff at the end of authentication phase? Internal redirects? I think I can do an internal redirect from a fixups hook, however, it seems somewhat difficult to construct a correct URI for passing to ap_inernal_redirect() there - in my case "/foo/bar/XXX/..." itself may be a result of one of many Aliases. Thank you, Vasiliy