fix(security): Change access rights on generated directories

Ppengrep complains, it is right.
This commit is contained in:
2025-07-06 10:51:09 +02:00
parent 14e8907437
commit 8999aabc21
2 changed files with 3 additions and 3 deletions

View File

@@ -95,7 +95,7 @@ func (chart *HelmChart) SaveTemplates(templateDir string) {
}
servicename := template.Servicename
if err := os.MkdirAll(filepath.Join(templateDir, servicename), 0o755); err != nil {
if err := os.MkdirAll(filepath.Join(templateDir, servicename), 0o600); err != nil {
fmt.Println(utils.IconFailure, err)
os.Exit(1)
}
@@ -103,7 +103,7 @@ func (chart *HelmChart) SaveTemplates(templateDir string) {
// if the name is a path, create the directory
if strings.Contains(name, string(filepath.Separator)) {
name = filepath.Join(templateDir, name)
err := os.MkdirAll(filepath.Dir(name), 0o755)
err := os.MkdirAll(filepath.Dir(name), 0o600)
if err != nil {
fmt.Println(utils.IconFailure, err)
os.Exit(1)

View File

@@ -173,7 +173,7 @@ func Convert(config ConvertOptions, dockerComposeFile ...string) error {
os.RemoveAll(config.OutputDir)
// create the chart directory
if err := os.MkdirAll(templateDir, 0o755); err != nil {
if err := os.MkdirAll(templateDir, 0o600); err != nil {
fmt.Println(utils.IconFailure, err)
os.Exit(1)
}