Skip to content

Commit

Permalink
Make written data files world-readable
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarx committed Dec 15, 2023
1 parent 98b6635 commit df74f34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helpers/rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{
fs::{metadata, File},
hash::Hash,
io::BufWriter,
os::unix::prelude::PermissionsExt,
path::PathBuf,
};
use strum::Display;
Expand All @@ -28,6 +29,8 @@ pub use sparql::{ClassLabelAndUsage, PropertyLabelAndType, PropertyUsage, Proper
pub use sql::sitelinks;
pub use statistics::DumpStatistics;

const DATA_FILE_MODE: u32 = 0o0644;

type Id = u32;
type Count = u32;
type LargeCount = u64;
Expand Down Expand Up @@ -233,7 +236,8 @@ impl Settings {
write(file.as_file_mut())?;
log::debug!("Wrote new JSON file: {} ...", name);

file.persist(self.data_file_path(data_file))?;
let file = file.persist(self.data_file_path(data_file))?;
file.set_permissions(PermissionsExt::from_mode(DATA_FILE_MODE))?;

log::debug!("Update for {} complete.", name);

Expand Down

0 comments on commit df74f34

Please sign in to comment.