Commit 15016f4d authored by Ad Schellevis's avatar Ad Schellevis

Small fix on config revert, loosly related to https://github.com/opnsense/core/issues/124

Use internal classes to restore a backup, to prevent overwrite by our singleton object
parent 948b5bcc
...@@ -235,18 +235,12 @@ function config_restore($conffile) { ...@@ -235,18 +235,12 @@ function config_restore($conffile) {
$cnf = OPNsense\Core\Config::getInstance(); $cnf = OPNsense\Core\Config::getInstance();
$cnf->backup(); $cnf->backup();
$cnf->restoreBackup($conffile);
$lockkey = lock('config', LOCK_EX);
copy($conffile, '/conf/config.xml');
disable_security_checks(); disable_security_checks();
unlock($lockkey);
$config = parse_config(); $config = parse_config();
write_config(gettext("Reverted to") . " " . array_pop(explode("/", $conffile)) . ".", false); write_config(gettext("Reverted to") . " " . array_pop(explode("/", $conffile)) . ".", false);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment