Skip to content

Commit 31a9ca6

Browse files
committed
intra: uid and pid in stats
1 parent b65d3ff commit 31a9ca6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

intra/tunnel.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"strings"
3535
"sync"
3636
"sync/atomic"
37+
"syscall"
3738
"time"
3839

3940
x "github.com/celzero/firestack/intra/backend"
@@ -518,7 +519,9 @@ func (t *rtunnel) stat() (*x.NetStat, error) {
518519
out.GOSt.NumCgo = int64(runtime.NumCgoCall())
519520
out.GOSt.NumCPU = int64(runtime.NumCPU())
520521

521-
out.GOSt.Args = strings.Join(os.Args, ";")
522+
uid := fmt.Sprintf("uid=%d", syscall.Getuid())
523+
pid := fmt.Sprintf("pid=%d", syscall.Getpid())
524+
out.GOSt.Args = strings.Join(append(os.Args, uid, pid), ";")
522525
out.GOSt.Env = strings.Join(core.RuntimeEnviron(), ";")
523526
out.GOSt.Pers, _ = os.Executable()
524527

0 commit comments

Comments
 (0)