Bug #5778
Changing an Interface name to be the same as an existing alias name still lets the user apply the changes
100%
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
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.
Clarify input validation output. Ticket #5778
History
#1
Updated by Phillip Davis about 5 years ago
For RELENG_2_2: https://github.com/pfsense/pfsense/pull/2465
For 2.3 master: https://github.com/pfsense/pfsense/pull/2466
#2
Updated by Phillip Davis about 5 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset f8bf3fe860c63b0a4f02093fe15e2874f8e52156.
#3
Updated by Phillip Davis about 5 years ago
Applied in changeset b9abac57ece83c4baeedfcd470dcab1084f98ae6.
#4
Updated by Chris Buechler about 5 years ago
- Status changed from Feedback to Resolved
works, thanks!
Fix #5778 do not save changes if interface description matches an alias name - RELENG_2_2