Fix ssh systemauth handling

This commit is contained in:
Bernd Schoolmann 2023-09-19 22:14:03 +02:00
parent 86cafcfc83
commit 10ec5f6fc9
No known key found for this signature in database
1 changed files with 6 additions and 1 deletions

View File

@ -24,8 +24,13 @@ func GetCallingContext(connection net.Conn) CallingContext {
panic(err)
}
pid, _ := creds.PID()
uid, _ := creds.UserID()
process, err := gops.FindProcess(pid)
if process.Executable() == "ssh-keygen" {
process, err = gops.FindProcess(process.PPid())
pid = process.Pid()
}
uid, _ := creds.UserID()
ppid := process.PPid()
if err != nil {
panic(err)