mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 02:54:38 +00:00
config - lock access to root and wheel group (ro), to align with backup storage. closes https://github.com/opnsense/core/issues/6831
This commit is contained in:
parent
56404c7c03
commit
58f5afba8e
@ -609,6 +609,7 @@ class Config extends Singleton
|
||||
$fhandle = fopen($this->config_file, "r+");
|
||||
if (flock($fhandle, LOCK_EX)) {
|
||||
fseek($fhandle, 0);
|
||||
chmod($this->config_file, 0640);
|
||||
ftruncate($fhandle, 0);
|
||||
fwrite($fhandle, file_get_contents($filename));
|
||||
fclose($fhandle);
|
||||
@ -720,6 +721,7 @@ class Config extends Singleton
|
||||
if ($this->config_file_handle !== null) {
|
||||
if (flock($this->config_file_handle, LOCK_EX)) {
|
||||
fseek($this->config_file_handle, 0);
|
||||
chmod($this->config_file, 0640);
|
||||
ftruncate($this->config_file_handle, 0);
|
||||
fwrite($this->config_file_handle, (string)$this);
|
||||
// flush, unlock, but keep the handle open
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user