summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-03-06 18:18:09 +0000
committerPaul Buetow <pbuetow@mimecast.com>2020-03-06 18:18:09 +0000
commit6622def60bb96652b19e5f63185b1b9cc8b01a48 (patch)
tree7432856bceccd966ddfd1c2e018799efd93da460 /internal
parent56cea081dbc10c2b2937dc395911d084179ec69f (diff)
make Mr. Lint happy
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go4
-rw-r--r--internal/pprof/pprof.go18
-rw-r--r--internal/server/server.go8
3 files changed, 6 insertions, 24 deletions
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
}
}