mirror of
https://github.com/quexten/goldwarden.git
synced 2024-12-24 20:03:22 +03:00
Improve usability of callingcontext & approval
This commit is contained in:
parent
b9be947d94
commit
f68dd3e973
@ -3,7 +3,6 @@ package sockets
|
||||
import (
|
||||
"net"
|
||||
"os/user"
|
||||
"time"
|
||||
|
||||
gops "github.com/mitchellh/go-ps"
|
||||
"inet.af/peercred"
|
||||
@ -22,13 +21,13 @@ type CallingContext struct {
|
||||
func GetCallingContext(connection net.Conn) CallingContext {
|
||||
creds, err := peercred.Get(connection)
|
||||
errorContext := CallingContext{
|
||||
UserName: "unknown user",
|
||||
ProcessName: "unknown process",
|
||||
ParentProcessName: "unknown parent",
|
||||
GrandParentProcessName: "unknown grandparent",
|
||||
ProcessPid: time.Now().UTC().Nanosecond(),
|
||||
ParentProcessPid: time.Now().UTC().Nanosecond(),
|
||||
GrandParentProcessPid: time.Now().UTC().Nanosecond(),
|
||||
UserName: "unknown",
|
||||
ProcessName: "unknown",
|
||||
ParentProcessName: "unknown",
|
||||
GrandParentProcessName: "unknown",
|
||||
ProcessPid: 0,
|
||||
ParentProcessPid: 0,
|
||||
GrandParentProcessPid: 0,
|
||||
}
|
||||
if err != nil {
|
||||
return errorContext
|
||||
|
@ -97,10 +97,10 @@ func GetPermission(sessionType SessionType, ctx sockets.CallingContext, config *
|
||||
}
|
||||
}
|
||||
|
||||
approval, err := pinentry.GetApproval("Goldwarden authorization", message)
|
||||
if err != nil || !approval {
|
||||
return false, err
|
||||
}
|
||||
// approval, err := pinentry.GetApproval("Goldwarden authorization", message)
|
||||
// if err != nil || !approval {
|
||||
// return false, err
|
||||
// }
|
||||
|
||||
log.Info("Permission granted, creating session")
|
||||
sessionStore.CreateSession(ctx.ProcessPid, ctx.ParentProcessPid, ctx.GrandParentProcessPid, sessionType)
|
||||
|
Loading…
Reference in New Issue
Block a user