Added seeding of default math/rand for key selection (#550)
parent
aa6c83f36e
commit
b26811ec4c
|
@ -4,11 +4,13 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/projectdiscovery/fileutil"
|
"github.com/projectdiscovery/fileutil"
|
||||||
"github.com/projectdiscovery/goflags"
|
"github.com/projectdiscovery/goflags"
|
||||||
|
@ -66,6 +68,9 @@ type Options struct {
|
||||||
|
|
||||||
// ParseOptions parses the command line flags provided by a user
|
// ParseOptions parses the command line flags provided by a user
|
||||||
func ParseOptions() *Options {
|
func ParseOptions() *Options {
|
||||||
|
// Seed default random number generator
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
|
||||||
// Migrate config to provider config
|
// Migrate config to provider config
|
||||||
if fileutil.FileExists(defaultConfigLocation) && !fileutil.FileExists(defaultProviderConfigLocation) {
|
if fileutil.FileExists(defaultConfigLocation) && !fileutil.FileExists(defaultProviderConfigLocation) {
|
||||||
gologger.Info().Msgf("Detected old %s config file, trying to migrate providers to %s\n", defaultConfigLocation, defaultProviderConfigLocation)
|
gologger.Info().Msgf("Detected old %s config file, trying to migrate providers to %s\n", defaultConfigLocation, defaultProviderConfigLocation)
|
||||||
|
|
Loading…
Reference in New Issue