removing script path for security

main
alex 2023-06-03 12:26:51 +02:00
parent 3e952c2921
commit 07bbe52530
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,15 @@ func GetCategoryGroupsSorted() []structs.CategoryGroup {
cgMu.Lock()
defer cgMu.Unlock()
// removing script path for security
for i, categoryGroup := range categoryGroups {
for i2, group := range categoryGroup.Groups {
for i3 := range group.Tasks {
categoryGroups[i].Groups[i2].Tasks[i3].ScriptPath = ""
}
}
}
sort.SliceStable(categoryGroups, func(i, j int) bool { return categoryGroups[i].Category < categoryGroups[j].Category })
return categoryGroups