1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +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:
Matteo Riondato 2022-04-13 09:38:44 +02:00 committed by Kristof Provost
parent 4642a6fac2
commit d86cf44350

View File

@ -1248,13 +1248,11 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
((void *)p == (void *)anchor_call ||
*(--p) == '/')) || (opts & PF_OPT_RECURSE))) {
brace++;
if ((p = strrchr(anchor_call, '/')) !=
NULL)
p++;
else
p = &anchor_call[0];
} else
p = &anchor_call[0];
int aclen = strlen(anchor_call);
if (anchor_call[aclen - 1] == '*')
anchor_call[aclen - 2] = '\0';
}
p = &anchor_call[0];
print_rule(&rule, p, rule_numbers, numeric);
if (brace)