From c59e78d3361c3fe9182ce747c0d5774c7f8693c3 Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 10 Oct 2024 10:24:14 +0000 Subject: [PATCH] Print the session id (PID of the session leader) instead of a pointer. Pointers are only visible when run as superuser. Also in most cases you want to know which process is the session leader and which process groups belong together. So it is better to print the session id. OK deraadt@ (long time ago) --- bin/ps/keyword.c | 4 ++-- bin/ps/ps.1 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 4ec98733594..8b4fd01929e 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keyword.c,v 1.52 2022/02/25 18:05:49 rob Exp $ */ +/* $OpenBSD: keyword.c,v 1.53 2024/10/10 10:24:14 claudio Exp $ */ /* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */ /*- @@ -158,7 +158,7 @@ VAR var[] = { {"rtable", "RTABLE", NULL, 0, pvar, 0, 0, POFF(p_rtableid), INT32, "d"}, UID("ruid", "RUID", pvar, POFF(p_ruid)), {"ruser", "RUSER", NULL, LJUST, runame, USERLEN}, - {"sess", "SESS", NULL, 0, pvar, PTRWIDTH, 0, POFF(p_sess), UINT64, "llx"}, + PID("sess", "SESS", pvar, POFF(p_sid)), {"sig", "PENDING", NULL, 0, pvar, 8, 0, POFF(p_siglist), INT32, "x"}, {"sigcatch", "CAUGHT", NULL, 0, pvar, 8, 0, POFF(p_sigcatch), UINT32, "x"}, {"sigignore", "IGNORED", diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 4452bdcc418..2ea4db84e1b 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ps.1,v 1.137 2024/08/21 03:07:45 deraadt Exp $ +.\" $OpenBSD: ps.1,v 1.138 2024/10/10 10:24:14 claudio Exp $ .\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $ .\" .\" Copyright (c) 1980, 1990, 1991, 1993, 1994 @@ -30,7 +30,7 @@ .\" .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: August 21 2024 $ +.Dd $Mdocdate: October 10 2024 $ .Dt PS 1 .Os .Sh NAME @@ -382,7 +382,7 @@ Real user ID. User name (from .Cm ruid ) . .It Cm sess -Session pointer. +Session ID (PID of session leader). .It Cm sig Alias: .Cm pending . -- 2.20.1