mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-16 10:08:12 +02:00
[client] UI Refactor Icon Paths (#3420)
[client] UI Refactor Icon Paths (#3420)
This commit is contained in:
24
client/ui/process/process_windows.go
Normal file
24
client/ui/process/process_windows.go
Normal file
@ -0,0 +1,24 @@
|
||||
package process
|
||||
|
||||
import (
|
||||
"os/user"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/process"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func isProcessOwnedByCurrentUser(p *process.Process) bool {
|
||||
processUsername, err := p.Username()
|
||||
if err != nil {
|
||||
log.Errorf("get process username error: %v", err)
|
||||
return false
|
||||
}
|
||||
|
||||
currUser, err := user.Current()
|
||||
if err != nil {
|
||||
log.Errorf("get current user error: %v", err)
|
||||
return false
|
||||
}
|
||||
|
||||
return processUsername == currUser.Username
|
||||
}
|
Reference in New Issue
Block a user