diff mbox series

[ovs-dev] ovsdb-server: Allow read-only config files.

Message ID 20260927232339.33508-1-ihar.hrachyshka@gmail.com
State New
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev] ovsdb-server: Allow read-only config files. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_FreeBSD_Build_and_Test success github build: passed

Commit Message

Ihar Hrachyshka Sept. 27, 2026, 11:23 p.m. UTC
With --config-file, ovsdb-server only reads the file while loading or
reloading configuration.  Configuration-changing unixctl commands are
rejected.  save_config() writes only the internal temporary file used
when --config-file is absent.

Open the user-provided file read-only so immutable configurations can
be used directly.

Fixes: 55140090e63a ("ovsdb-server: Allow user-provided config files.")
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
---
 ovsdb/ovsdb-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index af217476f..a7f89e148 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -642,7 +642,7 @@  reconfigure_ovsdb_server(struct server_config *server_config)
     FILE *file = NULL;
 
     if (config_file_path) {
-        file = fopen(config_file_path, "r+b");
+        file = fopen(config_file_path, "rb");
         if (!file) {
             VLOG_ERR("failed to open configuration file '%s': %s",
                      config_file_path, ovs_strerror(errno));