MCPcopy Create free account
hub / github.com/cloudflare/cfssl / scanMain

Function scanMain

cli/scan/scan.go:87–120  ·  view source on GitHub ↗
(args []string, c cli.Config)

Source from the content-addressed store, hash-verified

85}
86
87func scanMain(args []string, c cli.Config) (err error) {
88 if c.List {
89 printJSON(scan.Default)
90 } else {
91 if err = scan.LoadRootCAs(c.CABundleFile); err != nil {
92 return
93 }
94
95 if len(args) >= c.MaxHosts {
96 log.Warningf("Only scanning max-hosts=%d out of %d args given", c.MaxHosts, len(args))
97 args = args[:c.MaxHosts]
98 } else if c.CSVFile != "" {
99 args, err = parseCSV(args, c.CSVFile, c.MaxHosts)
100 if err != nil {
101 return
102 }
103 }
104
105 ctx := newContext(c, c.NumWorkers)
106 // Execute for each HOST argument given
107 for len(args) > 0 {
108 var host string
109 host, args, err = cli.PopFirstArgument(args)
110 if err != nil {
111 return
112 }
113
114 ctx.hosts <- host
115 }
116 close(ctx.hosts)
117 ctx.Wait()
118 }
119 return
120}
121
122// Command assembles the definition of Command 'scan'
123var Command = &cli.Command{UsageText: scanUsageText, Flags: scanFlags, Main: scanMain}

Callers 1

TestScanMainFunction · 0.85

Calls 6

LoadRootCAsFunction · 0.92
WarningfFunction · 0.92
PopFirstArgumentFunction · 0.92
printJSONFunction · 0.85
parseCSVFunction · 0.85
newContextFunction · 0.70

Tested by 1

TestScanMainFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…