diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2020-03-06 18:18:09 +0000 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2020-03-06 18:18:09 +0000 |
| commit | 6622def60bb96652b19e5f63185b1b9cc8b01a48 (patch) | |
| tree | 7432856bceccd966ddfd1c2e018799efd93da460 | |
| parent | 56cea081dbc10c2b2937dc395911d084179ec69f (diff) | |
make Mr. Lint happy
| -rw-r--r-- | go.mod | 2 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | internal/config/config.go | 4 | ||||
| -rw-r--r-- | internal/pprof/pprof.go | 18 | ||||
| -rw-r--r-- | internal/server/server.go | 8 |
5 files changed, 9 insertions, 25 deletions
@@ -5,5 +5,5 @@ go 1.13 require ( github.com/DataDog/zstd v1.4.4 golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 - golang.org/x/lint v0.0.0-20200130185559-910be7a94367 // indirect + golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect ) @@ -6,6 +6,8 @@ golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90 golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= diff --git a/internal/config/config.go b/internal/config/config.go index 166e143..7241276 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -9,8 +9,8 @@ import ( // ControlUser is used for various DTail specific operations. const ControlUser string = "DTAIL-CONTROL-USER" -// ScheduledUser is used for scheduled queries. -const ScheduleUser string = "DTAIL-SCHEDULED-USER" +// ScheduleUser is used for scheduled queries. +const ScheduleUser string = "DTAIL-SCHEDULE-USER" // Client holds a DTail client configuration. var Client *ClientConfig diff --git a/internal/pprof/pprof.go b/internal/pprof/pprof.go deleted file mode 100644 index c6d11ca..0000000 --- a/internal/pprof/pprof.go +++ /dev/null @@ -1,18 +0,0 @@ -package pprof - -import ( - "fmt" - "net/http" - _ "net/http" - _ "net/http/pprof" - - "github.com/mimecast/dtail/internal/config" - "github.com/mimecast/dtail/internal/io/logger" -) - -// Start the profiler HTTP server. -func Start() { - bindAddr := fmt.Sprintf("%s:%d", config.Common.PProfBindAddress, config.Common.PProfPort) - logger.Info("Starting PProf server", bindAddr) - go http.ListenAndServe(bindAddr, nil) -} diff --git a/internal/server/server.go b/internal/server/server.go index 0b93537..4ffe4d9 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -224,15 +224,15 @@ func (s *Server) schedueleUserCanHaveSSHSession(addr string, user *user.User, jo continue } for _, myAddr := range job.AllowFrom { - myIps, err := net.LookupIP(myAddr) + myIPs, err := net.LookupIP(myAddr) if err != nil { logger.Error(user, myAddr, err) continue } - for _, myIp := range myIps { - logger.Debug("schedueleUserCanHaveSSHSession", "Comparing IP addresses", ip, myIp.String()) - if ip == myIp.String() { + for _, myIP := range myIPs { + logger.Debug("schedueleUserCanHaveSSHSession", "Comparing IP addresses", ip, myIP.String()) + if ip == myIP.String() { return true } } |
