Protect sys-tuner socket access at create (#7230)

automerge
This commit is contained in:
Pankaj Garg
2019-12-03 14:29:37 -08:00
committed by Grimes
parent 1af4e256c9
commit c996c8ff49
3 changed files with 3 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ fn tune_system() {
#[cfg(unix)]
fn main() {
solana_logger::setup();
unsafe { libc::umask(0o077) };
if let Err(e) = std::fs::remove_file(solana_sys_tuner::SOLANA_SYS_TUNER_PATH) {
if e.kind() != std::io::ErrorKind::NotFound {
panic!("Failed to remove stale socket file: {:?}", e)