mirror of
https://github.com/samhocevar/rinetd.git
synced 2024-12-26 12:50:20 +08:00
Fix a parsing bug in the rules that would ignore the very first rule. See #23.
This commit is contained in:
parent
af88e6fd4f
commit
d4e0a60119
@ -474,7 +474,7 @@ YY_ACTION(void) yy_1_auth_rule(yycontext *yy, char *yytext, int yyleng)
|
||||
}
|
||||
allRules[allRulesCount].type = yy->isAuthAllow ? allowRule : denyRule;
|
||||
if (seTotal > 0) {
|
||||
if (seInfo[seTotal - 1].rulesStart == 0) {
|
||||
if (seInfo[seTotal - 1].rulesStart == 0 && seInfo[seTotal - 1].rulesCount == 0) {
|
||||
seInfo[seTotal - 1].rulesStart = allRulesCount;
|
||||
}
|
||||
++seInfo[seTotal - 1].rulesCount;
|
||||
|
@ -98,7 +98,7 @@ auth-rule = auth-key - < pattern >
|
||||
}
|
||||
allRules[allRulesCount].type = yy->isAuthAllow ? allowRule : denyRule;
|
||||
if (seTotal > 0) {
|
||||
if (seInfo[seTotal - 1].rulesStart == 0) {
|
||||
if (seInfo[seTotal - 1].rulesStart == 0 && seInfo[seTotal - 1].rulesCount == 0) {
|
||||
seInfo[seTotal - 1].rulesStart = allRulesCount;
|
||||
}
|
||||
++seInfo[seTotal - 1].rulesCount;
|
||||
|
Loading…
Reference in New Issue
Block a user