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) {
$cnf = OPNsense\Core\Config::getInstance();
$cnf->backup();
$lockkey = lock('config', LOCK_EX);
copy($conffile, '/conf/config.xml');
$cnf->restoreBackup($conffile);
disable_security_checks();
unlock($lockkey);
$config = parse_config();
write_config(gettext("Reverted to") . " " . array_pop(explode("/", $conffile)) . ".", false);
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