INNER CODE UNIT · Go

err

pilinux/gorest · config/config.go:706

	if err = os.MkdirAll(path, 0750); err != nil { // #nosec G703 -- path is constrained to the workspace root by sanitizeConfigDir
		return err
	}

	return nil
}

// sanitizeConfigDir ensures that the provided directory is a valid relative path and does not lead outside the workspace.
func sanitizeConfigDir(dir string) (string, error) {
	cleanDir := filepath.Clean(strings.TrimSpace(dir))

	path, err := lib.ValidatePath(cleanDir, ".")
	if err != nil {
		return "", errInvalidConfigDir
	}

	return path, nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…