diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-05-22 01:23:41 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-05-22 01:23:41 -0400 |
commit | 63601c5ebb22c2c1c0f0b079a723aba961b337d1 (patch) | |
tree | 2c4ee54a2c0d5b59dbd870808ec2cab9cf84e323 /src/bin | |
parent | 1bc09a9c74d0d1c47d1b88b5833ad8174fc04928 (diff) | |
download | rbw-63601c5ebb22c2c1c0f0b079a723aba961b337d1.tar.gz rbw-63601c5ebb22c2c1c0f0b079a723aba961b337d1.zip |
don't allow setting lock_timeout to 0
this isn't useful, because the agent will just drop the keys as soon as
they are unlocked, before they can be used to decrypt anything
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/rbw/commands.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs index 6d90010..b3caa18 100644 --- a/src/bin/rbw/commands.rs +++ b/src/bin/rbw/commands.rs @@ -317,9 +317,14 @@ pub fn config_set(key: &str, value: &str) -> anyhow::Result<()> { "base_url" => config.base_url = Some(value.to_string()), "identity_url" => config.identity_url = Some(value.to_string()), "lock_timeout" => { - config.lock_timeout = value + let timeout = value .parse() - .context("failed to parse value for lock_timeout")? + .context("failed to parse value for lock_timeout")?; + if timeout == 0 { + log::error!("lock_timeout must be greater than 0"); + } else { + config.lock_timeout = timeout; + } } _ => return Err(anyhow::anyhow!("invalid config key: {}", key)), } |