mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
sameuser: log the uid/remoteUID when they are not matching (#2535)
Updates https://github.com/golang/vscode-go/issues/1555
This commit is contained in:
committed by
GitHub
parent
688f94a4f8
commit
1ecdb3be05
@ -1,4 +1,5 @@
|
|||||||
//+build linux
|
//go:build linux
|
||||||
|
// +build linux
|
||||||
|
|
||||||
package sameuser
|
package sameuser
|
||||||
|
|
||||||
@ -56,7 +57,11 @@ func sameUserForHexLocalAddr(filename, hexaddr string) (bool, error) {
|
|||||||
if localAddr != hexaddr {
|
if localAddr != hexaddr {
|
||||||
continue
|
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}
|
return false, &errConnectionNotFound{filename}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user