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

This commit is contained in:
Ulyssa 2023-07-07 20:34:52 -07:00
parent 64891ec68f
commit 3da9835a17
No known key found for this signature in database
GPG key ID: F2873CA2997B83C5
3 changed files with 8 additions and 0 deletions

View file

@ -694,6 +694,12 @@ fn main() -> IambResult<()> {
// Load configuration and set up the Matrix SDK.
let settings = ApplicationSettings::load(iamb).unwrap_or_else(print_exit);
// Set umask on Unix platforms so that tokens, keys, etc. are only readable by the user.
#[cfg(unix)]
unsafe {
libc::umask(0o077);
};
// Set up the tracing subscriber so we can log client messages.
let log_prefix = format!("iamb-log-{}", settings.profile_name);
let log_dir = settings.dirs.logs.as_path();