Project

General

Profile

Actions

Regression #14412

closed

PHP error when attempting to bulk import Alias content

Added by Jim Pingle 11 months ago. Updated 11 months ago.

Status:
Resolved
Priority:
Very High
Assignee:
Category:
Aliases / Tables
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05.1
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:

Description

Saving after attempting bulk import of a new alias on firewall_aliases_import.php results in the alias configuration being broken and PHP errors on every GUI page and console prevent making any changes.

When saving after import, the configuration section for aliases ends up as:

    <aliases>
        <alias>0</alias>
    </aliases>

Where the content is the next alias ID. For example, if there were one existing alias at the time, the value is 1. If there are 5, it's 5, and so on.

The PHP error is due to the corrupted alias configuration and isn't as important:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/util.inc:2053
Stack trace:
#0 /etc/inc/config.gui.inc(56): alias_make_table()
#1 /etc/inc/auth.inc(34): require_once('/etc/inc/config...')
#2 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...')
#3 /usr/local/www/guiconfig.inc(62): require_once('/etc/inc/authgu...')
#4 /usr/local/www/firewall_aliases.php(35): require_once('/usr/local/www/...')
#5 {main}
  thrown in /etc/inc/util.inc on line 2053

That error doesn't necessarily need fixed here if we can prevent the data from being corrupted, but it might be nice to have that bail in a more user-friendly way.

Actions #1

Updated by Jim Pingle 11 months ago

Looks like it was broken during a recent bulk refactor in 29cd08ea0da6246ad416e33b3788c05c0b0a5172, fix is very simple, as is preventing everything from blowing up due to the bad config entry. Fix incoming momentarily.

Actions #2

Updated by Jim Pingle 11 months ago

  • Status changed from Confirmed to Feedback
  • % Done changed from 0 to 100
Actions #3

Updated by Danilo Zrenjanin 11 months ago

  • Status changed from Feedback to Resolved

I replicated the issue on the:

23.05-RELEASE (amd64)
built on Mon May 22 15:04:36 UTC 2023
FreeBSD 14.0-CURRENT

The patch fixes it. I am marking this ticket resolved.

Actions #4

Updated by Jim Pingle 11 months ago

  • Plus Target Version changed from 23.09 to 23.05.1
Actions #5

Updated by Jim Pingle 11 months ago

  • Affected Version set to 2.7.0
Actions

Also available in: Atom PDF