Skip to content

Commit 66327c7

Browse files
wyfoOlivierHecart
andauthored
prevent config update at runtime except for plugins (#1955)
* prevent config update at runtime They are not taken into account, except for plugins in adminspace. * Notifier::insert_json5 returns an error if the provided key does not start with plugins/ --------- Co-authored-by: OlivierHecart <olivier.hecart@adlinktech.com>
1 parent 70a5922 commit 66327c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

zenoh/src/api/config.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ impl Notifier<Config> {
248248
}
249249

250250
pub fn insert_json5(&self, key: &str, value: &str) -> ZResult<()> {
251+
if !key.starts_with("plugins/") {
252+
bail!(
253+
"Error inserting conf value {} : updating config is only \
254+
supported for keys starting with `plugins/`",
255+
key
256+
);
257+
}
251258
self.lock_config().insert_json5(key, value)?;
252259
self.notify(key);
253260
Ok(())

0 commit comments

Comments
 (0)