From 3dc69f1c132b59fcdf6c859b0f097d5a525cc115 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 31 May 2021 22:13:36 +0100 Subject: [PATCH] config: Break out some variables etc. Signed-off-by: Ian Jackson --- src/bin/otter.rs | 2 +- src/config.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 566d229d..90e485c1 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -1878,7 +1878,7 @@ mod mgmtchannel_proxy { } inventory::submit!{Subcommand( - "mgmtchannel-proxy", + SSH_PROXY_SUBCMD, "connect to management channel and copy raw message data back and forth", call, )} diff --git a/src/config.rs b/src/config.rs index b544407b..e5b3a74e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,6 +14,8 @@ pub const EXIT_DISASTER : i32 = 16; pub const DEFAULT_CONFIG_DIR : &str = "/etc/otter"; pub const DEFAULT_CONFIG_LEAFNAME : &str = "server.toml"; pub const DEFAULT_SENDMAIL_PROGRAM : &str = "/usr/sbin/sendmail"; +pub const DEFAULT_SSH_PROXY_CMD : &str = "otter-ssh-proxy"; +pub const SSH_PROXY_SUBCMD : &str = "mgmtchannel-proxy"; pub const DAEMON_STARTUP_REPORT: &str = "otter-daemon started"; pub const LOG_ENV_VAR: &str = "OTTER_LOG"; @@ -164,7 +166,7 @@ impl ServerConfigSpec { specd.unwrap_or_else(|| format!("{}/{}", &libexec_dir, leaf)) }; let usvg_bin = in_libexec(usvg_bin, "usvg" ); - let ssh_proxy_bin = in_libexec(ssh_proxy_bin,"otter-ssh-proxy" ); + let ssh_proxy_bin = in_libexec(ssh_proxy_bin, DEFAULT_SSH_PROXY_CMD ); let authorized_keys = if let Some(ak) = authorized_keys { ak } else { let home = home().context("for authorized_keys")?; -- 2.30.2