From d0f097f844399da500235ca38ed50c7987293ae3 Mon Sep 17 00:00:00 2001 From: poscat Date: Sun, 3 Nov 2024 19:43:00 +0800 Subject: [PATCH] use umask 022 by default so rootfs have correct permissions --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5bcc7fa..26ff57f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,7 @@ use console::{style, user_attended}; use dotenvy::dotenv; use std::process; use std::{path::Path, process::Command}; +use libc; use crate::actions::BuildSettings; use crate::common::*; @@ -99,6 +100,9 @@ fn update_tree(path: &Path, branch: Option<&String>, rebase_from: Option<&String } fn main() -> Result<()> { + // set umask to 022 to ensure correct permissions on rootfs + libc::umask(libc::S_IWGRP | libc:: S_IWOTH); + // source .env file, ignore errors dotenv().ok();