daemon: Trim cookie string

If the cookie file had a newline in it, the program would not work
This commit is contained in:
2022-04-28 15:19:38 +02:00
parent e2649165a7
commit 590d58c152

View File

@ -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 {