files: default mode

This commit is contained in:
Mikaël Cluseau 2023-11-27 16:08:09 +01:00
parent 3f2cd997a0
commit 1555419549

View File

@ -147,7 +147,12 @@ func applyConfig(cfgPath string, bootMounted bool) (cfg *configV1) {
log.Printf("failed to create dir %s: %v", filepath.Dir(fileDef.Path), err) log.Printf("failed to create dir %s: %v", filepath.Dir(fileDef.Path), err)
} }
err = os.WriteFile(filePath, []byte(fileDef.Content), fileDef.Mode) mode := fileDef.Mode
if mode == 0 {
mode = 0644
}
err = os.WriteFile(filePath, []byte(fileDef.Content), mode)
if err != nil { if err != nil {
fatalf("failed to write %s: %v", fileDef.Path, err) fatalf("failed to write %s: %v", fileDef.Path, err)
} }