From 65eb6c905a3d91766d2bef398210cbd5eb0d9cdd Mon Sep 17 00:00:00 2001 From: Oscar Linderholm Date: Thu, 4 Apr 2019 20:25:21 +0200 Subject: [PATCH 1/2] Only allow owner read/write to credentials.toml --- src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 430a614..b75bfcf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,11 +115,21 @@ fn main() { let credentials: Credentials = { let path = config::config_path("credentials.toml"); - ::config::load_or_generate_default(path, authentication::create_credentials, true) + let creds = + ::config::load_or_generate_default(&path, authentication::create_credentials, true) + .unwrap_or_else(|e| { + eprintln!("{}", e); + process::exit(1); + }); + + #[cfg(target_family = "unix")] + std::fs::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o600)) .unwrap_or_else(|e| { eprintln!("{}", e); process::exit(1); - }) + }); + + creds }; let theme = theme::load(&cfg); From f755ea11c61c184441ec3e7281eec0af643581ef Mon Sep 17 00:00:00 2001 From: Henrik Friedrichsen Date: Sun, 31 Mar 2019 18:46:13 +0200 Subject: [PATCH 2/2] bump version of webbrowser dependency for bsd support --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c8ee8b7..d7914e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ tokio-timer = "0.2" unicode-width = "0.1.5" dbus = { version = "0.6.4", optional = true } rand = "0.6.5" -webbrowser = "0.4" +webbrowser = "0.5" [dependencies.librespot] git = "https://github.com/librespot-org/librespot.git"