You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Firewall: Rules [new] - remove direct "Config::getInstance()->save()" #10198
Does this need a wrapper around Config::getInstance()->save(); that does this check that is needed before calling it, or is such a check already built-in somewhere?
I did take a quick look here but nothing caught my eye:
no, frontend callers should guarantee consistency in this case, in this case we should probably just call $this->save() instead of the current serializeToConfig() + Config::getInstance()->save() currently used.
changed the title [-]core: "Config::getInstance()->save()" seems to be an edgecase of privilege "user-config-readonly"[/-][+] Firewall: Rules [new] - remove direct "Config::getInstance()->save()"[/+]on Apr 23, 2026
Activity
AdSchellevis commentedon Apr 23, 2026
well, actually,
Config::getInstance()->save();shouldn't be called without checking.Monviech commentedon Apr 23, 2026
Does this need a wrapper around
Config::getInstance()->save();that does this check that is needed before calling it, or is such a check already built-in somewhere?I did take a quick look here but nothing caught my eye:
core/src/opnsense/mvc/app/library/OPNsense/Core/Config.php
Line 743 in ea6f710
AdSchellevis commentedon Apr 23, 2026
no, frontend callers should guarantee consistency in this case, in this case we should probably just call
$this->save()instead of the currentserializeToConfig()+Config::getInstance()->save()currently used.core/src/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableModelControllerBase.php
Line 322 in ea6f710
Monviech commentedon Apr 23, 2026
I understand. I will take this one. Thanks for pointing the boundary out.
[-]core: "Config::getInstance()->save()" seems to be an edgecase of privilege "user-config-readonly"[/-][+] Firewall: Rules [new] - remove direct "Config::getInstance()->save()"[/+]