Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I ran into an almost identical problem just now. I'm using a module that someone else wrote. On one test machine the module was doing authN and authZ correctly. On a different machine <code>r-&gt;filename</code> was <code>NULL</code> inside of the auth checker hook. Your question here came up first in my google search.</p> <p>In my case I tracked it down to an incorrect usage of <code>ap_set_module_config</code>. The code looked like:</p> <pre><code>ap_set_module_config(r, &amp;auth_my_module, attrs); </code></pre> <p>The source code for <code>ap_set_module_config</code> says this:</p> <pre><code>/** * Generic accessors for other modules to set at their own module-specific * data * @param conf_vector The vector in which the modules configuration is stored. * usually r-&gt;per_dir_config or s-&gt;module_config * @param m The module to set the data for. * @param val The module-specific data to set */ AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m, void *val); </code></pre> <p>I changed the the call to <code>ap_set_module_config</code> to this:</p> <pre><code>ap_set_module_config(r-&gt;per_dir_config, &amp;auth_my_module, attrs); </code></pre> <p>And just like magic, <code>r-&gt;filename</code> is no longer <code>NULL</code> in the auth checker hook. I'm new to writing apache modules so I need to find out exactly what this means, but I'm glad I figured out where the problem is. You might check your code to see how you call <code>ap_set_module_config</code>.</p> <p><strong>Edit:</strong> I should add that I tracked this down by adding debug statements that showed me exactly when the <code>filename</code> field of the <code>request_rec</code> struct became <code>NULL</code>. For me it went from valid to <code>NULL</code> inside a hook I defined.</p> <p>Good luck!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload