httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Nicholes" <BNICHO...@novell.com>
Subject Re: Appeal for help understanding fiendishly complex data structure in mod_authz_core
Date Tue, 21 Mar 2006 23:38:01 GMT
> {>>> On 3/19/2006 at 8:40:56 am, in message <441D7B88.50401@ukf.net>, 
> maxb1@ukf.net 
> wrote:
> mod_authz_core contains a fiendishly complex data structure, the
>'authz_provider_list' (which is actually more like a tree than a list),
>which is used to implement the concept of nested
><SatisfyOne>/<SatisfyAll> sections.
>
>
>I've been trying off-and-on for about a week to understand this
>structure, and the code that creates and walks it, but have been
>unsuccessful.
>
>
>I'm sending this email as an appeal for assistance understanding this
>code, and also as an alert that this code may prove to be a potential
>maintenance problem, if it is so difficult to comprehend.
>
>Thanks,
>Max.

You are right, the piece of code that traverses the <SatisfyOne/All> list is a bit complex
which is the reason why I tried to document it well according to what the code is doing. 
If I could have made this code simpler, obviously I would have.  The basic concept behind
the code as I see it, is a list that grows horizontally or vertically with each nested state
change (ie. one vs all). The only other component that is tracked while the list (or tree)
is being traversed is the nesting level.  The nesting level simply indicates how many state
changes have occurred within a given path from the root node to the leaf node.  I'm not sure
that I can explain the code much better through an email than is already explained in the
comments and source code that exist in the add_authz_provider() or check_provider_list() functions.
 When adding a node to the list, the idea is to follow the nesting path until a leaf node
is encountered and then add the new node to the leaf node depending on whether the new node
maintains the same state or introduces a state change.  When checking the provider list, each
provider in the list must be satisfied according to it's state and boolean logic.

Brad



Mime
View raw message