Project

General

Profile

Actions

Bug #3765

closed

Port alias creation and expansion leaves white space padding, causes is_numeric() tests on port validity to fail.

Added by Stilez y over 11 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/19/2014
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:

Description

I entered a port alias ("Myport" defined as 999) through the 2.1.4 FW->"Alias"->"Port" UI, as part of a test. Using standard functions, I then wanted to extract the alias value for use in a function.

Result:

1) $config['aliases']['Myport'] was entered normally, but got saved in $config with white space padding somehow (SPC SPC 999 not plain 999). So alias creation isn't stripping out white space, but may retain or add white space padding as part of the stored alias value.

2) filter_expand_alias() failed to detect this on expansion. Notedso someone can confirm this is correct behaviour (ie, that it's the calling function's job to do so and valid values are not guaranteed).

3) filter_expand_alias() doesn't seem to be doing anything beyond normal expansion of aliases. As any function in any part of pfSense might need alias expansion, it's illogical and unclear why the function to expand a port alias is in filters.inc while all other port alias functions, and the functions to expand all other aliases (and all other alias management library code generally) is in utils.inc.

Can the port alias expansion function be moved to utils.inc, and referred to from function.inc as usual, to keep it simple and so functions don't have to load filter.inc just to expand an alias?

Actions #1

Updated by Chris Buechler almost 10 years ago

  • Status changed from New to Resolved

the space issue doesn't exist in 2.3. The remainder is correct behavior.

Actions

Also available in: Atom PDF