Project

General

Profile

Bug #8445

creating an alias named "log" breaks rule processing

Added by lists b over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Rules / NAT
Target version:
Start date:
04/08/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.3
Affected Architecture:
All

Description

i created an ip alias, and named it "log". upon the rules reloading, an error occurred:

There were error(s) loading the rules: /tmp/rules.debug:45: syntax error - The line in question reads [45]: table <log> persist

here is some context from rules.debug:

44: irc_server = "<irc_server>"
45: ircs_u = "{ 6697 }"
46: table <log> persist
47: log = "<log>"
48: managesieve = "{ 4190 }"
49: table <mda> persist
50: mda = "<mda>"

it's pretty clear why it broke. although i would like to be able to use whatever string i'd like for the name of an alias, if this constraint persists, it would probably be wise to disallow the user from using this string.

Associated revisions

Revision b20cfb55 (diff)
Added by Jim Pingle over 1 year ago

Replace incomplete list of pf reserved words with a list of pf tokens pulled from the pf source. Fixes #8445

Also, move the list to a central location so it does not need to be duplicated.

Revision ef799458 (diff)
Added by Jim Pingle over 1 year ago

Replace incomplete list of pf reserved words with a list of pf tokens pulled from the pf source. Fixes #8445

Also, move the list to a central location so it does not need to be duplicated.

(cherry picked from commit b20cfb55125207e21d81a29a107ea77230fbc7fb)

History

#1 Updated by Jim Pingle over 1 year ago

  • Category set to Rules / NAT
  • Status changed from New to Confirmed
  • Assignee set to Jim Pingle
  • Target version set to 2.4.4
  • Affected Version set to 2.4.3
  • Affected Architecture set to All

It's a reserved keyword in pf but isn't in the list.

#2 Updated by Jim Pingle over 1 year ago

The list of pf keywords was a lot shorter than it should be, but there isn't a documented list that I could see.

I found a more complete token list in the pfctl source: https://github.com/pfsense/FreeBSD-src/blob/devel-11/sbin/pfctl/parse.y#L459

I tried a few random keywords from the list and they all generated similar pf errors, so it should be a better starting point.

As for using these names in aliases, pf is case sensitive. If you want to call an alias "log", too bad, but you can call it "Log" or "LOG" and be fine. Or prefix with another valid character such as "_" for "_log" if you must have lowercase.

#3 Updated by Jim Pingle over 1 year ago

  • Status changed from Confirmed to Feedback
  • % Done changed from 0 to 100

#4 Updated by James Dekker over 1 year ago

Tested on latest 2.4.4 CE snapshot gitsync'd to master, works as expected.

#5 Updated by Jim Pingle over 1 year ago

  • Status changed from Feedback to Resolved

#6 Updated by Jim Pingle over 1 year ago

  • Target version changed from 2.4.4 to 2.4.3-p1

Also available in: Atom PDF