| 1704 | } |
| 1705 | |
| 1706 | static int |
| 1707 | pfr_validate_table(struct pfr_table *tbl, int allowedflags, int no_reserved) |
| 1708 | { |
| 1709 | int i; |
| 1710 | |
| 1711 | if (!tbl->pfrt_name[0]) |
| 1712 | return (-1); |
| 1713 | if (no_reserved && !strcmp(tbl->pfrt_anchor, PF_RESERVED_ANCHOR)) |
| 1714 | return (-1); |
| 1715 | if (tbl->pfrt_name[PF_TABLE_NAME_SIZE-1]) |
| 1716 | return (-1); |
| 1717 | for (i = strlen(tbl->pfrt_name); i < PF_TABLE_NAME_SIZE; i++) |
| 1718 | if (tbl->pfrt_name[i]) |
| 1719 | return (-1); |
| 1720 | if (pfr_fix_anchor(tbl->pfrt_anchor)) |
| 1721 | return (-1); |
| 1722 | if (tbl->pfrt_flags & ~allowedflags) |
| 1723 | return (-1); |
| 1724 | return (0); |
| 1725 | } |
| 1726 | |
| 1727 | /* |
| 1728 | * Rewrite anchors referenced by tables to remove slashes |
no test coverage detected