/[pdpsoft]/trunk/grid-mw-security/ees/src/eval_man/pdl.c
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/src/eval_man/pdl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1105 by aramv, Fri Nov 13 01:04:08 2009 UTC revision 1106 by aramv, Fri Nov 13 09:48:18 2009 UTC
# Line 168  rule_t* add_rule(record_t* state, record Line 168  rule_t* add_rule(record_t* state, record
168  }  }
169    
170  rule_t* check_for_recursion(rule_t* rule_l, rule_t* rule_r){  rule_t* check_for_recursion(rule_t* rule_l, rule_t* rule_r){
171    if((rule_l != NULL) && (rule_r != NULL)){    rule_t* temp_rule = rule_l;
172      /* left hand and right hand state are equal */    while(temp_rule){
173      if(strcmp(rule_l->state, rule_r->state) == 0){      if((temp_rule != NULL) && (rule_r != NULL)){
174        return rule_r;        /* left hand and right hand state are equal */
175      }        if(strcmp(temp_rule->state, rule_r->state) == 0){
176            return rule_r;
177      /* start state and true branch of right hand rule are equal */        }
178      if(rule_r->true_branch){        /* start state and true branch of right hand rule are equal */
179        if(strcmp(rule_l->state, rule_r->true_branch->state) == 0){        if(rule_r->true_branch){
180          return rule_r->true_branch;          if(strcmp(temp_rule->state, rule_r->true_branch->state) == 0){
181              return rule_r->true_branch;
182            }
183          } else {
184            return NULL;
185        }        }
186      } else {      } else {
187        return NULL;        return NULL;
188      }      }
189    } else {      /* move to next rule */
190      return NULL;      temp_rule = temp_rule->next;
191    }    }
192      return NULL;
   /* recurse */  
   return check_for_recursion(rule_l->next, rule_r);  
193  }  }
194    
195  /* Tries to find specified state in the list */  /* Tries to find specified state in the list */

Legend:
Removed from v.1105  
changed lines
  Added in v.1106

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28