From e7767080dbaff3a9c3b3694c2009b781f1d9487a Mon Sep 17 00:00:00 2001 From: anipaul2 Date: Fri, 12 May 2023 01:07:36 +0530 Subject: [PATCH] Prevent overwrite_key and force_update from being set in the config file These parameters are dangerous and should only be set via command line flags. This change causes the application to panic if they are set in the configuration file, and updates the parameters to be settable only via the command line. --- teos/src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/teos/src/config.rs b/teos/src/config.rs index 5436725f..c5e1e820 100644 --- a/teos/src/config.rs +++ b/teos/src/config.rs @@ -203,6 +203,12 @@ impl Config { self.tor_support |= options.tor_support; self.debug |= options.debug; self.deps_debug |= options.deps_debug; + if self.overwrite_key { + panic!("The 'overwrite_key' parameter cannot be set in the configuration file."); + } + if self.force_update { + panic!("The 'force_update' parameter cannot"); + } self.overwrite_key = options.overwrite_key; self.force_update = options.force_update; }