Project

General

Profile

Bug #7294

Lenght of description of firewall rules

Added by Pablo Trincavelli 4 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Category:
Rules/NAT
Target version:
Start date:
02/22/2017
Due date:
% Done:

0%

Affected version:
All
Affected Architecture:
All

Description

When adding or modifying a firewall rule, the description field accept more characters than are saved, so the description gets truncated.

Associated revisions

Revision adb19456
Added by Jim Pingle 4 months ago

Adjust fix for ticket #7294 for 2.3.x, it used a setHelp change that was only valid on 2.4.

History

#1 Updated by Phillip Davis 4 months ago

firewall_rules_edit.php
strncpy($filterent['descr'], $_POST['descr'], 52);

I wonder why it limits that to 52?
One char per week of the year :)

I will guess that the description is later passed somewhere into the pf ruleset maybe, so it can appear somewhere in logs...?

#2 Updated by Jim Pingle 4 months ago

  • Category set to Rules/NAT
  • Target version set to 2.4.0
  • Affected version set to All
  • Affected Architecture set to All

That's a pf limitation. We prefix user rules with "USER_RULE: " (11 chars) then the description and the total length of the description (including the prefix) has to be 63 or under. See https://github.com/pfsense/pfsense/blob/master/src/etc/inc/filter.inc#L122

63-11=52

#4 Updated by Renato Botelho 4 months ago

  • Assignee set to Renato Botelho

#5 Updated by Jim Pingle about 2 months ago

  • Status changed from New to Resolved
  • Target version changed from 2.4.0 to 2.3.4

PR was merged and it has been working

Also available in: Atom PDF