Skip to content

Commit

Permalink
sameuser: log the uid/remoteUID when they are not matching (go-delve#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hyangah authored Jun 15, 2021
1 parent 688f94a commit 1ecdb3b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions service/internal/sameuser/sameuser_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build linux
//go:build linux
// +build linux

package sameuser

Expand Down Expand Up @@ -56,7 +57,11 @@ func sameUserForHexLocalAddr(filename, hexaddr string) (bool, error) {
if localAddr != hexaddr {
continue
}
return uid == int(remoteUID), nil
same := uid == int(remoteUID)
if !same && logflags.Any() {
log.Printf("connection from different user (remote: %d, local: %d) detected: %v", remoteUID, uid, line)
}
return same, nil
}
return false, &errConnectionNotFound{filename}
}
Expand Down

0 comments on commit 1ecdb3b

Please sign in to comment.