* Rewrite anchors referenced by tables to remove slashes * and check for validity. */
| 1729 | * and check for validity. |
| 1730 | */ |
| 1731 | static int |
| 1732 | pfr_fix_anchor(char *anchor) |
| 1733 | { |
| 1734 | size_t siz = MAXPATHLEN; |
| 1735 | int i; |
| 1736 | |
| 1737 | if (anchor[0] == '/') { |
| 1738 | char *path; |
| 1739 | int off; |
| 1740 | |
| 1741 | path = anchor; |
| 1742 | off = 1; |
| 1743 | while (*++path == '/') |
| 1744 | off++; |
| 1745 | bcopy(path, anchor, siz - off); |
| 1746 | memset(anchor + siz - off, 0, off); |
| 1747 | } |
| 1748 | if (anchor[siz - 1]) |
| 1749 | return (-1); |
| 1750 | for (i = strlen(anchor); i < siz; i++) |
| 1751 | if (anchor[i]) |
| 1752 | return (-1); |
| 1753 | return (0); |
| 1754 | } |
| 1755 | |
| 1756 | int |
| 1757 | pfr_table_count(struct pfr_table *filter, int flags) |
no test coverage detected