Project

General

Profile

Actions

Bug #12124

closed

Creating or editing aliases fails with multiple hosts separated by spaces

Added by Casin Mirad 3 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Category:
Aliases / Tables
Target version:
Start date:
07/12/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
21.09
Release Notes:
Default
Affected Version:
2.5.x
Affected Architecture:
All

Description

Normally you can input multiple host/network aliases on the first form input if you separate each with an space.

This work ok in pfsense 2.4.1, but in 2.5.2 (also in 2.5.1) if you input a rather large (say 280+ chars string) amount of IPs/host/networks separed by an space in the same form input, the process fails with an error.

I've tracked the issue to the idn_to_ascii php function returning an invalid value with a large string input.

The following patch resolve the issue by disabling idn to ascii convertion:

--- /usr/local/pfSense/include/www/alias-utils.inc
+++ /usr/local/pfSense/include/www/alias-utils.inc
@ -344,7 +344,7 @
$detail_text = sprintf(gettext("Entry added %s"), date('r'));
}

- $address_items = explode(" ", trim(alias_idn_to_ascii($post["address{$x}"])));
+ $address_items = explode(" ", trim($post["address{$x}"]));
foreach ($address_items as $address_item) {
$iprange_type = is_iprange($address_item);
if ($iprange_type == 4) {

I think the problem is trying to pass idn_to_ascii the whole string, maybe passing the individual exploded strings one by one to idn_to_ascii does not trigger the issue.

Actions #1

Updated by Christian McDonald 3 months ago

  • Status changed from New to Pull Request Review
  • Assignee set to Christian McDonald
Actions #2

Updated by Renato Botelho 3 months ago

  • Status changed from Pull Request Review to Feedback
  • Target version set to 2.6.0
  • Plus Target Version set to 21.09

PR has been merged. Thanks!

Actions #3

Updated by Christian McDonald 3 months ago

  • % Done changed from 0 to 100
Actions #4

Updated by Danilo Zrenjanin 3 months ago

  • Status changed from Feedback to Resolved

Tested on the:

2.6.0-DEVELOPMENT (amd64)
built on Thu Jul 15 09:42:13 EDT 2021
FreeBSD 12.2-STABLE

It works fine now. Ticket resolved.

Actions #5

Updated by Jim Pingle about 2 months ago

  • Subject changed from Creating or editing aliases fails when inputting multiple hosts separated by spaces to Creating or editing aliases fails with multiple hosts separated by spaces

Updating subject for release notes.

Actions

Also available in: Atom PDF