Project

General

Profile

Bug #5778

Changing an Interface name to be the same as an existing alias name still lets the user apply the changes

Added by Phillip Davis almost 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Interfaces
Target version:
Start date:
01/18/2016
Due date:
% Done:

100%

Estimated time:
Affected Version:
All
Affected Architecture:

Description

1) Make an alias, e.g. ZLAN
2) Interfaces->LAN - change the description to ZLAN

A message is displayed "Sorry, an alias with the name ZLAN already exists." But actually the change has already been saved to config.xml. The "Apply changes" box and button is showing.

3) Press Apply

Now you get "Error loading the rules" notice.

This happens in 2.2.6 (and presumably earlier releases) and in 2.3. I will provide PRs for both.

Associated revisions

Revision b9abac57 (diff)
Added by Phillip Davis almost 4 years ago

Fix #5778 do not save changes if interface description matches an alias name - RELENG_2_2

Revision f8bf3fe8 (diff)
Added by Phillip Davis almost 4 years ago

Fix #5778 do not save changes if interface description matches an alias name

See https://redmine.pfsense.org/issues/5778 for details of how to reproduce the problem.

Note that similar code to make the "Sorry, an alias with the name XXX already exists" message is also at the top of interfaces.inc - it compares the current interface descr from the config with the currently existing alias names. That check would help warn the user if someone managed to add an alias name that matched the interface name. I guess it was there from some time in the past when the alias edit code did not cross-validate the alias name with the interface descriptions. I have left that check there - it does no harm to have it "just in case".

The new code that I added checks the proposed interface description in $_POST against the existing alias names and will give an input_error if there is a match.

Revision 61d93eb3 (diff)
Added by Chris Buechler almost 4 years ago

Clarify input validation output. Ticket #5778

History

#2 Updated by Phillip Davis almost 4 years ago

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

#4 Updated by Chris Buechler almost 4 years ago

  • Status changed from Feedback to Resolved

works, thanks!

Also available in: Atom PDF