| 602 | } |
| 603 | |
| 604 | int checkACL(struct clientparam * param){ |
| 605 | struct ace* acentry; |
| 606 | |
| 607 | if(!param->srv->acl) { |
| 608 | return alwaysauth(param); |
| 609 | } |
| 610 | for(acentry = param->srv->acl; acentry; acentry = acentry->next) { |
| 611 | if(ACLmatches(acentry, param)) { |
| 612 | param->nolog = acentry->nolog; |
| 613 | param->weight = acentry->weight; |
| 614 | if(acentry->action == 2) { |
| 615 | struct ace dup; |
| 616 | |
| 617 | if(param->operation < 256 && !(param->operation & CONNECT)){ |
| 618 | continue; |
| 619 | } |
| 620 | if(param->redirected && acentry->chains && SAISNULL(&acentry->chains->addr) && !*SAPORT(&acentry->chains->addr)) { |
| 621 | continue; |
| 622 | } |
| 623 | dup = *acentry; |
| 624 | return handleredirect(param, &dup); |
| 625 | } |
| 626 | return acentry->action; |
| 627 | } |
| 628 | } |
| 629 | return 3; |
| 630 | } |
| 631 | |
| 632 | struct authcache { |
| 633 | char * username; |
no test coverage detected