Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-09 Thread Jeff Trawick
On Sun, Jun 9, 2013 at 8:00 AM, Steinar H. Gunderson  wrote:

> On Sun, Jun 09, 2013 at 11:57:54AM +0200, Stefan Fritsch wrote:
> > 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:
>
> Either way is fine by me; the only thing mpm-itk needs is really DECLINED
> or exit(). :-)
>

Do you have time to test with this patch on top of 2.4.x and report back?

http://people.apache.org/~sf/open_htaccess_hook.patch

Thanks!


> /* Steinar */
> --
> Homepage: http://www.sesse.net/
>



-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-10 Thread Steinar H. Gunderson
On Tue, Jul 09, 2013 at 08:53:03AM -0400, Jeff Trawick wrote:
> Do you have time to test with this patch on top of 2.4.x and report back?
> 
> http://people.apache.org/~sf/open_htaccess_hook.patch

Hi,

I've tried this, adjusted mpm-itk, and it seems to work. Why do I need to
return AP_DECLINED and not DECLINED from this hook, though?

FWIW, here's my hook:

ap_hook_open_htaccess(itk_open_htaccess, NULL, NULL, APR_HOOK_REALLY_FIRST);

[...]

static apr_status_t itk_open_htaccess(request_rec *r,
  const char *dir_name, const char 
*access_name,
  ap_configfile_t **conffile, const 
char **full_name)
{
int status;

if (!ap_has_irreversibly_setuid || r->main != NULL) {
return AP_DECLINED;
}

*full_name = ap_make_full_path(r->pool, dir_name, access_name);
status = ap_pcfg_openfile(conffile, r->pool, *full_name);

if (APR_STATUS_IS_EACCES(status)) {
 ap_log_rerror(APLOG_MARK, APLOG_WARNING, errno, r,
   "Couldn't read %s, closing connection.",
   *full_name);
 ap_lingering_close(r->connection);
 exit(0);
}

return status;
}

I don't like all that much having to duplicate the “official” hook
(in particular the ap_make_full_path() call), but I guess it's better than
what used to be there, and it's only two lines.

/* Steinar */
-- 
Homepage: http://www.sesse.net/


Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-10 Thread Rainer Jung
On 10.07.2013 13:14, Steinar H. Gunderson wrote:
> On Tue, Jul 09, 2013 at 08:53:03AM -0400, Jeff Trawick wrote:
>> Do you have time to test with this patch on top of 2.4.x and report back?
>>
>> http://people.apache.org/~sf/open_htaccess_hook.patch
> 
> Hi,
> 
> I've tried this, adjusted mpm-itk, and it seems to work. Why do I need to
> return AP_DECLINED and not DECLINED from this hook, though?

http://mail-archives.apache.org/mod_mbox/httpd-dev/201307.mbox/%3calpine.deb.2.00.1307031352000.14...@eru.sfritsch.de%3E

Regards,

Rainer



Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-10 Thread Stefan Fritsch
On Wednesday 10 July 2013, Steinar H. Gunderson wrote:
> I don't like all that much having to duplicate the “official” hook
> (in particular the ap_make_full_path() call), but I guess it's
> better than what used to be there, and it's only two lines.

Yes, that's the price to pay for the more flexible hook which supports 
additional use cases. I think these two lines are acceptable.

Cheers,
Stefan


Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-10 Thread Jeff Trawick
On Wed, Jul 10, 2013 at 2:30 PM, Stefan Fritsch  wrote:

> On Wednesday 10 July 2013, Steinar H. Gunderson wrote:
> > I don't like all that much having to duplicate the “official” hook
> > (in particular the ap_make_full_path() call), but I guess it's
> > better than what used to be there, and it's only two lines.
>
> Yes, that's the price to pay for the more flexible hook which supports
> additional use cases. I think these two lines are acceptable.
>

I think this issue was the original objection to solving the problem with
this particular API (voiced or unvoiced), but I agree that the additional
use cases make it worthwhile.

I guess "it seems to work" in the earlier e-mail is the validation that the
API is sufficient for MPM-ITK.


> Cheers,
> Stefan
>



-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-22 Thread Steinar H. Gunderson
On Wed, Jul 10, 2013 at 03:07:56PM -0400, Jeff Trawick wrote:
> I guess "it seems to work" in the earlier e-mail is the validation that the
> API is sufficient for MPM-ITK.

Hi,

I see that 2.4.6 has been released, with no mention of open_htaccess in the
source code. Was this reverted after 2.4.5? Or was it simply never applied to
the 2.4.x branch?

/* Steinar */
-- 
Homepage: http://www.sesse.net/


Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-24 Thread Stefan Fritsch
Am Montag, 22. Juli 2013, 19:58:11 schrieb Steinar H. Gunderson:
> On Wed, Jul 10, 2013 at 03:07:56PM -0400, Jeff Trawick wrote:
> > I guess "it seems to work" in the earlier e-mail is the validation
> > that the API is sufficient for MPM-ITK.


> I see that 2.4.6 has been released, with no mention of open_htaccess
> in the source code. Was this reverted after 2.4.5? Or was it simply
> never applied to the 2.4.x branch?

Unfortunately, it didn't get the necessary three +1 votes in time and 
hasn't been applied to the 2.4.x branch, yet.



Re: Hey Steinar... Re: Revisiting the pre_htaccess hook

2013-07-24 Thread Jeff Trawick
On Wed, Jul 24, 2013 at 3:31 PM, Stefan Fritsch  wrote:

> Am Montag, 22. Juli 2013, 19:58:11 schrieb Steinar H. Gunderson:
> > On Wed, Jul 10, 2013 at 03:07:56PM -0400, Jeff Trawick wrote:
> > > I guess "it seems to work" in the earlier e-mail is the validation
> > > that the API is sufficient for MPM-ITK.
>
>
> > I see that 2.4.6 has been released, with no mention of open_htaccess
> > in the source code. Was this reverted after 2.4.5? Or was it simply
> > never applied to the 2.4.x branch?
>
> Unfortunately, it didn't get the necessary three +1 votes in time and
> hasn't been applied to the 2.4.x branch, yet.
>
>
Now it is approved for 2.4.next.

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/