mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
pfctl: fix recursive printing of rules
When asked to print rules recursively, correctly recurse for anchors included in pf.conf with "anchorname/*". PR: 262590 Reviewed by: kp MFC after: 3 weeks
This commit is contained in:
parent
4642a6fac2
commit
d86cf44350
@ -1248,13 +1248,11 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
|
|||||||
((void *)p == (void *)anchor_call ||
|
((void *)p == (void *)anchor_call ||
|
||||||
*(--p) == '/')) || (opts & PF_OPT_RECURSE))) {
|
*(--p) == '/')) || (opts & PF_OPT_RECURSE))) {
|
||||||
brace++;
|
brace++;
|
||||||
if ((p = strrchr(anchor_call, '/')) !=
|
int aclen = strlen(anchor_call);
|
||||||
NULL)
|
if (anchor_call[aclen - 1] == '*')
|
||||||
p++;
|
anchor_call[aclen - 2] = '\0';
|
||||||
else
|
}
|
||||||
p = &anchor_call[0];
|
p = &anchor_call[0];
|
||||||
} else
|
|
||||||
p = &anchor_call[0];
|
|
||||||
|
|
||||||
print_rule(&rule, p, rule_numbers, numeric);
|
print_rule(&rule, p, rule_numbers, numeric);
|
||||||
if (brace)
|
if (brace)
|
||||||
|
Loading…
Reference in New Issue
Block a user