Skip to content

Commit

Permalink
fix: fixing var declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
yasminvalim committed Nov 7, 2023
1 parent 3f7db36 commit 9870713
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions config/fcos/v1_6_exp/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,35 +413,32 @@ func processModule(rendered types.Config, module Module, options common.Translat
r.AddOnError(yamlPath, err)
return rendered
}
filePath := fmt.Sprintf("/etc/selinux/targeted/modules/active/extra/%s.cil", module.Name)

if isValidModule(module) {
filePath := fmt.Sprintf("/etc/selinux/targeted/modules/active/extra/%s.cil", module.Name)

rendered.Storage.Files = append(rendered.Storage.Files,
types.File{
Node: types.Node{
Path: filePath,
},
FileEmbedded1: types.FileEmbedded1{
Append: []types.Resource{
{
Source: util.StrToPtr(src),
Compression: compression,
},
rendered.Storage.Files = append(rendered.Storage.Files,
types.File{
Node: types.Node{
Path: filePath,
},
FileEmbedded1: types.FileEmbedded1{
Append: []types.Resource{
{
Source: util.StrToPtr(src),
Compression: compression,
},
},
})

commandToExecute := "semodule -i"
cmd := exec.Command(commandToExecute, filePath)
err := cmd.Run()
if err != nil {
fmt.Printf("Error running semodule %v", module.Name)
}
},
})

fmt.Printf("SELinux module file imported successfully\n")
commandToExecute := "semodule -i"
cmd := exec.Command(commandToExecute, filePath)
err = cmd.Run()
if err != nil {
fmt.Printf("Error running semodule %v", module.Name)
}

fmt.Printf("SELinux module file imported successfully\n")

ts.AddFromCommonSource(yamlPath, path.New("json", "storage"), rendered.Storage)

return rendered
Expand Down

0 comments on commit 9870713

Please sign in to comment.