On 17/02/2006, at 10:01 AM, Jim Gallacher wrote:

The ap_check_cmd_context function may also be of interest.

For example, lets say we wanted to disallow the use of PythonDebug in <VirtualHost>

  const char *err;
    if ((err = ap_check_cmd_context(cmd, NOT_IN_VIRTUALHOST))) {
       return err;
    } else {
      /* do some processing */

The one I can't find a good way of doing is, how do I determine if a directive
was used in a .htaccess file.

If you use a directive in a <Directory> container, you will know because you
can search back through parent containers of command and find it. For a
.htaccess file, I would have assumed there would have been an implicit
<Directory> container created or some other indicator, but I can't find any.

The only kludge I can even dream of at the moment is to rely on the fact
that the filename attribute will identify the full path to the .htaccess file. If I can be sure that it is a .htaccess file, I can take the dirname of it and use that
as the req.hlist.directory.

The particular problem I am trying to solve is the PythonHandler in <Files>
container inside of a .htaccess file. Ie., MODPYTHON-126.

Don't know how to work that one out do you? :-(


Reply via email to