Commit 3da9835a17

3da9835a17742ed5080d446096682c86a96b0655

parent: 64891ec68f

Unregistered key

Ulyssa <git@ulyssa.dev> · 2023-07-08 03:34 UTC

Profile session token should only be readable by the user (#130)

Layout: unified · split

Cargo.lock +1
@@ -1527,6 +1527,7 @@ dependencies = [
1527 "html5ever", 1527 "html5ever",
1528 "image", 1528 "image",
1529 "lazy_static 1.4.0", 1529 "lazy_static 1.4.0",
1530 "libc",
1530 "mandown", 1531 "mandown",
1531 "markup5ever_rcdom", 1532 "markup5ever_rcdom",
1532 "matrix-sdk", 1533 "matrix-sdk",
Cargo.toml +1
@@ -35,6 +35,7 @@ futures = "0.3"
35gethostname = "0.4.1" 35gethostname = "0.4.1"
36html5ever = "0.26.0" 36html5ever = "0.26.0"
37image = "0.24.5" 37image = "0.24.5"
38libc = "0.2"
38markup5ever_rcdom = "0.2.0" 39markup5ever_rcdom = "0.2.0"
39mime = "^0.3.16" 40mime = "^0.3.16"
40mime_guess = "^2.0.4" 41mime_guess = "^2.0.4"
src/main.rs +6
@@ -694,6 +694,12 @@ fn main() -> IambResult<()> {
694 // Load configuration and set up the Matrix SDK. 694 // Load configuration and set up the Matrix SDK.
695 let settings = ApplicationSettings::load(iamb).unwrap_or_else(print_exit); 695 let settings = ApplicationSettings::load(iamb).unwrap_or_else(print_exit);
696 696
697 // Set umask on Unix platforms so that tokens, keys, etc. are only readable by the user.
698 #[cfg(unix)]
699 unsafe {
700 libc::umask(0o077);
701 };
702
697 // Set up the tracing subscriber so we can log client messages. 703 // Set up the tracing subscriber so we can log client messages.
698 let log_prefix = format!("iamb-log-{}", settings.profile_name); 704 let log_prefix = format!("iamb-log-{}", settings.profile_name);
699 let log_dir = settings.dirs.logs.as_path(); 705 let log_dir = settings.dirs.logs.as_path();