diff --git a/utils/io/fileutils/zip.go b/utils/io/fileutils/zip.go index 4ae49023b..4273c3ee7 100644 --- a/utils/io/fileutils/zip.go +++ b/utils/io/fileutils/zip.go @@ -35,10 +35,10 @@ func Unzip(at io.ReaderAt, size int64, dest string) error { path := filepath.Join(dest, f.Name) if f.FileInfo().IsDir() { - os.MkdirAll(path, f.Mode()) + os.MkdirAll(path, 0700) } else { - os.MkdirAll(filepath.Dir(path), f.Mode()) - f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode()) + os.MkdirAll(filepath.Dir(path), 0700) + f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700) if err != nil { return err } diff --git a/utils/utils.go b/utils/utils.go index 62099837a..aea55996f 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -235,16 +235,10 @@ func CheckErrorWithMessage(err error, message string) error { return err } -func GetMapFromStringSlice(slice []string, sep string) map[string]string { - mapFromSlice := make(map[string]string) +func ConvertSliceToMap(slice []string) map[string]bool { + mapFromSlice := make(map[string]bool) for _, value := range slice { - splitted := strings.Split(value, sep) - if len(splitted) == 2 { - mapFromSlice[splitted[0]] = splitted[1] - } - if len(splitted) == 1 { - mapFromSlice[splitted[0]] = "" - } + mapFromSlice[value] = true } return mapFromSlice }