opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.34k stars 748 forks source link

Aliases: Crash report is generated when trying to delete an alias which is in use by a filter rule #6098

Closed mlht closed 2 years ago

mlht commented 2 years ago

Describe the bug OPNsense 22.7.6 Deleting an alias which is in use by a filter rule is not allowed. This is correct. But a crash report with php errors is generated:

[18-Oct-2022 19:27:17 Europe/Berlin] OPNsense\Base\UserException: Cannot delete alias. Currently in use by [filter.rule.0/source.address] Test in /usr/local/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasController.php:160 Stack trace:

0 [internal function]: OPNsense\Firewall\Api\AliasController->delItemAction('da063796-b7be-4...')

1 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->callActionMethod(Object(OPNsense\Firewall\Api\AliasController), 'delItemAction', Array)

2 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()

3 /usr/local/opnsense/www/api.php(24): Phalcon\Mvc\Application->handle('/api/firewall/a...')

4 {main}

(Haven't seen this before version 22.7)

AdSchellevis commented 2 years ago

looks like a side affect indeed, UserExceptions should only appear on screen. @mlht Thanks for reporting!