Skip to content

Commit

Permalink
psgo: use the host process to read uids/gids
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed May 29, 2020
1 parent fbef66e commit a083b59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions psgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ func processHPID(p *process.Process, ctx *psContext) (string, error) {
func processHUSER(p *process.Process, ctx *psContext) (string, error) {
if hp := findHostProcess(p, ctx); hp != nil {
if ctx.opts != nil && len(ctx.opts.UIDMap) > 0 {
return findID(p.Status.Uids[1], ctx.opts.UIDMap, process.LookupUID, "/proc/sys/fs/overflowuid")
return findID(hp.Status.Uids[1], ctx.opts.UIDMap, process.LookupUID, "/proc/sys/fs/overflowuid")
}
return hp.Huser, nil
}
Expand All @@ -846,7 +846,7 @@ func processHUSER(p *process.Process, ctx *psContext) (string, error) {
func processHGROUP(p *process.Process, ctx *psContext) (string, error) {
if hp := findHostProcess(p, ctx); hp != nil {
if ctx.opts != nil && len(ctx.opts.GIDMap) > 0 {
return findID(p.Status.Gids[1], ctx.opts.GIDMap, process.LookupGID, "/proc/sys/fs/overflowgid")
return findID(hp.Status.Gids[1], ctx.opts.GIDMap, process.LookupGID, "/proc/sys/fs/overflowgid")
}
return hp.Hgroup, nil
}
Expand Down

0 comments on commit a083b59

Please sign in to comment.