Skip to content

Commit 8d79521

Browse files
committed
sun: trust procfs directory PID
1 parent e2da74c commit 8d79521

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎lib/dialects/sun/dproc.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,9 @@ void gather_proc_info(struct lsof_context *ctx) {
533533
memcpy(&ps_euid, &ps[euidoff], sizeof(ps_euid));
534534
(void)memcpy(cmd, &ps[fnameoff], sizeof(cmd) - 1);
535535
cmd[sizeof(cmd) - 1] = '\0';
536+
/* Use the /proc directory PID as the authoritative PID. */
536537
if (ps_pid != pid)
537-
continue;
538+
ps_pid = pid;
538539
if (is_proc_excl(ctx, pid, (int)ps_pgid, (UID_ARG)ps_uid, &pss,
539540
&sf) ||
540541
is_cmd_excl(ctx, cmd, &pss, &sf))

0 commit comments

Comments
 (0)