diff options
| author | Calvin Morrison <calvin@pobox.com> | 2026-08-18 22:05:20 -0400 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2026-08-18 22:05:20 -0400 |
| commit | 2f408deee4d88ebd2ee87bbf5fe227ff764e0e6d (patch) | |
| tree | e347c53f3c945dfd1ae9ea741223e4c658246347 /pim/go.sum | |
| parent | 330c2a27a998a2a0d8b31af10edf087558ea7050 (diff) | |
rules: a rule set is not 64 kilobytes long
fmtrules formatted into a 64K buffer with seprint, which clamps, and
returned how much it had written. Nothing looked at whether that was
everything. Since prepend, append and delete all work by formatting
the whole set out, editing the text and parsing it back -- deliberately,
so that a rule typed at ctl and a rule in a file go through one parser
-- editing a set past the limit did not truncate the display, it
truncated the rules.
Measured with 2000 rules, about 104K formatted:
and all of it comes back want: 2000 got: 1214
and survives an edit want: ok got: refused
with nothing lost off the end got: 1214
786 rules gone from the running firewall, and the only sign is that the
edit after it failed. save wrote the same short file, so reload would
then have made the loss permanent.
Now sized and allocated to fit. The bound is per rule -- the fixed
attributes at their longest, plus the protocol, which is the only part
whose length is ndb's choice rather than ours -- summed under the same
lock that formats, so an install cannot get between the two passes.
flows had the identical cap and gets the identical fix; on a busy
firewall it is the file most likely to reach it. Rulebuf is gone.
Six checks: a 2000-rule set loads, comes back whole, survives an edit,
and saves whole.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'pim/go.sum')
0 files changed, 0 insertions, 0 deletions
