[mod_python] PythonAuthzHandler not working

Graham Dumpleton grahamd at dscpl.com.au
Thu Apr 20 23:18:28 EDT 2006


Graham Dumpleton wrote ..
> Graham Dumpleton wrote ..
> > Add to config:
> > 
> >   AuthAuthoritative Off
> >   Require dummy
> > 
> > The value to Require cannot be:
> > 
> >   valid-user
> >   user ???
> >   group ???
> > 
> > it has to be something of your own creation that your authz handler then
> > interprets.
> > 
> > I am noting that authzhandler() can't return DECLINED, but must be OK,
> > or presumable HTTP_UNAUTHORIZED. Returning DECLINED results in 500
> > error and:
> > 
> > [Fri Apr 21 12:10:43 2006] [crit] [client ::1] configuration error: 
> couldn't
> > check access.  No groups file?: /~grahamd/authz/index.py 
> 
> This last issue still occurs with PythonHandlersModule even with the changes
> I gave above, so something definitely wrong with how mod_python does
> things when that directive is used. That whole directive is a pain in the
> neck
> and I very doubt it gets used anyway. Wish we could nuke it. :-)

And the reason it breaks is that PythonHandlerModule forgets to setup
the call to PythonAuthenHandler.

    python_directive_handler(cmd, mconfig, "PythonPostReadRequestHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonTransHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonHeaderParserHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonAccessHandler", val, SILENT);

     # PythonAuthenHandler missing here.

    python_directive_handler(cmd, mconfig, "PythonAuthzHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonTypeHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonInitHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonLogHandler", val, SILENT);
    python_directive_handler(cmd, mconfig, "PythonCleanupHandler", val, SILENT);

Been that way since 3.0. :-)

Graham


More information about the Mod_python mailing list