mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
config access, don't try to open config.xml in write mode when file is not writeable. closes https://github.com/opnsense/core/issues/3241
This commit is contained in:
parent
dd1d8cba05
commit
5123277a85
@ -351,7 +351,12 @@ class Config extends Singleton
|
||||
}
|
||||
|
||||
if (!is_resource($this->config_file_handle)) {
|
||||
$this->config_file_handle = fopen($this->config_file, "r+");
|
||||
if (is_writable($this->config_file)) {
|
||||
$this->config_file_handle = fopen($this->config_file, "r+");
|
||||
} else {
|
||||
// open in read-only mode
|
||||
$this->config_file_handle = fopen($this->config_file, "r");
|
||||
}
|
||||
}
|
||||
|
||||
$this->simplexml = $this->loadFromStream($this->config_file_handle);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user