From 2c6c1961ca0b786ac38004bc98d6ab3750e4935c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 4 Aug 2020 14:33:20 +0200 Subject: [PATCH] explicitly set permissions --- src/store.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store.rs b/src/store.rs index 15b4c31..71f45c6 100644 --- a/src/store.rs +++ b/src/store.rs @@ -1,7 +1,8 @@ use md5::Context; use std::fs; -use std::fs::File; +use std::fs::{File, Permissions}; use std::io::{ErrorKind, Read, Write}; +use std::os::unix::fs::PermissionsExt; use std::path::{Path, PathBuf}; pub struct Store { @@ -37,6 +38,7 @@ impl Store { context.consume(data); file.write_all(data)?; + file.set_permissions(Permissions::from_mode(0o644))?; } }