[OpenSER-Devel] Bug in rule.c of Openser permissions module
Giovanni Coriasco
giovanni.coriasco at csp.it
Mon Sep 17 08:29:35 CEST 2007
Hi,
I think I found a bug in the code of the permissions module.
The problem was that only the first line of the allow_routing permission
files were handled properly. I found the problem in the search_rule()
function in rule.c.
The left expression was not properly evaluated because it was read from
the 'r' pointer and not from the 'r1' that was the iterated one: thus I
changed the expression "(!r->left)" into "(!r1->left)" (at line 105 of
"rule.c") and everything seems to work correctly now.
I'm attaching a diff file for the "rule.c" patch to this email.
Bye
Giovanni
-------------- next part --------------
*** rule.c.orig 2007-09-13 09:33:04.000000000 +0200
--- rule.c 2007-09-13 09:35:46.000000000 +0200
***************
*** 102,108 ****
r1 = r;
while (r1) {
! if (( (!r->left) || (search_expression(r1->left, left)) )
&& (!search_expression(r1->left_exceptions, left))
&& ( (!r1->right) || (search_expression(r1->right, right)) )
&& (!search_expression(r1->right_exceptions, right))) return 1;
--- 102,108 ----
r1 = r;
while (r1) {
! if (( (!r1->left) || (search_expression(r1->left, left)) )
&& (!search_expression(r1->left_exceptions, left))
&& ( (!r1->right) || (search_expression(r1->right, right)) )
&& (!search_expression(r1->right_exceptions, right))) return 1;
More information about the Devel
mailing list