mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Merge pull request #190 from safing/fix/profile-name
Fix exposing the wrong profile name on the connection process context
This commit is contained in:
commit
224ae219da
1 changed files with 14 additions and 8 deletions
|
@ -27,15 +27,19 @@ type FirewallHandler func(conn *Connection, pkt packet.Packet)
|
||||||
// ProcessContext holds additional information about the process
|
// ProcessContext holds additional information about the process
|
||||||
// that iniated a connection.
|
// that iniated a connection.
|
||||||
type ProcessContext struct {
|
type ProcessContext struct {
|
||||||
// Name is the name of the process.
|
// ProcessName is the name of the process.
|
||||||
Name string
|
ProcessName string
|
||||||
|
//ProfileName is the name of the profile.
|
||||||
|
ProfileName string
|
||||||
// BinaryPath is the path to the process binary.
|
// BinaryPath is the path to the process binary.
|
||||||
BinaryPath string
|
BinaryPath string
|
||||||
// PID i the process identifier.
|
// PID i the process identifier.
|
||||||
PID int
|
PID int
|
||||||
// ProfileID is the ID of the main profile that
|
// Profile is the ID of the main profile that
|
||||||
// is applied to the process.
|
// is applied to the process.
|
||||||
ProfileID string
|
Profile string
|
||||||
|
// Source is the source of the profile.
|
||||||
|
Source string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connection describes a distinct physical network connection
|
// Connection describes a distinct physical network connection
|
||||||
|
@ -164,9 +168,11 @@ type Reason struct {
|
||||||
func getProcessContext(proc *process.Process) ProcessContext {
|
func getProcessContext(proc *process.Process) ProcessContext {
|
||||||
return ProcessContext{
|
return ProcessContext{
|
||||||
BinaryPath: proc.Path,
|
BinaryPath: proc.Path,
|
||||||
Name: proc.Name,
|
ProcessName: proc.Name,
|
||||||
|
ProfileName: proc.Profile().LocalProfile().Name,
|
||||||
PID: proc.Pid,
|
PID: proc.Pid,
|
||||||
ProfileID: proc.LocalProfileKey,
|
Profile: proc.Profile().LocalProfile().ID,
|
||||||
|
Source: string(proc.Profile().LocalProfile().Source),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue