Skip to content

Commit 9110d8c

Browse files
poscat0x04MingcongBai
authored andcommitted
use umask 022 by default so rootfs have correct permissions
1 parent 28ce194 commit 9110d8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use console::{style, user_attended};
1818
use dotenvy::dotenv;
1919
use std::process;
2020
use std::{path::Path, process::Command};
21+
use libc;
2122

2223
use crate::actions::BuildSettings;
2324
use crate::common::*;
@@ -99,6 +100,9 @@ fn update_tree(path: &Path, branch: Option<&String>, rebase_from: Option<&String
99100
}
100101

101102
fn main() -> Result<()> {
103+
// set umask to 022 to ensure correct permissions on rootfs
104+
unsafe { libc::umask(libc::S_IWGRP | libc:: S_IWOTH); }
105+
102106
// source .env file, ignore errors
103107
dotenv().ok();
104108

0 commit comments

Comments
 (0)