From 590d58c15249d58b53e3f3e41ed8b3f5089a5a23 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Thu, 28 Apr 2022 15:19:38 +0200 Subject: [PATCH] daemon: Trim cookie string If the cookie file had a newline in it, the program would not work --- cli/src/daemon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/daemon.rs b/cli/src/daemon.rs index cc3b051..2251b6d 100644 --- a/cli/src/daemon.rs +++ b/cli/src/daemon.rs @@ -18,7 +18,7 @@ use tokio::task::{spawn, JoinHandle}; pub fn run(opt: DaemonOpt) -> Result<(), Error> { let opt: &'static DaemonOpt = Box::leak(Box::new(opt)); let cookie: &'static str = - Box::leak(std::fs::read_to_string(&opt.cookie_file)?.into_boxed_str()); + Box::leak(std::fs::read_to_string(&opt.cookie_file)?.into_boxed_str()).trim(); let rt = Runtime::new()?; rt.block_on(async {