Files
netbird/client/uiwails/process/process_nonwindows.go
Zoltán Papp 04a982263d Wails UI
2026-03-02 15:59:09 +01:00

26 lines
419 B
Go

//go:build !windows
package process
import (
"os"
"github.com/shirou/gopsutil/v3/process"
log "github.com/sirupsen/logrus"
)
func isProcessOwnedByCurrentUser(p *process.Process) bool {
currentUserID := os.Getuid()
uids, err := p.Uids()
if err != nil {
log.Errorf("get process uids: %v", err)
return false
}
for _, id := range uids {
if int(id) == currentUserID {
return true
}
}
return false
}