git: 428200d2f068 - main - RELNOTES: ps(1): Document change in behavior for '-a'/'-A'

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Wed, 07 May 2025 09:15:34 UTC
The branch main has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=428200d2f0689aa801f5cab15d3066e2c77825f5

commit 428200d2f0689aa801f5cab15d3066e2c77825f5
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-05-06 13:42:33 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-05-07 09:14:50 +0000

    RELNOTES: ps(1): Document change in behavior for '-a'/'-A'
    
    Document the practical consequence of change "ps(1): Make '-a' and '-A'
    always show all processes" (93a94ce731a8) that specifying '-a'/'-A'
    leads to printing all processes regardless of the presence of other
    process selection options (except for '-x'/'-X', which command
    a filter).
    
    While here, mention a possible practical issue with '-J', as reported by
    dch@.  This option was introduced by commit "Add -J to filter by
    matching jail IDs and names." (13767130c7147ae7182a, r265229), which
    unfortunately talked about '-J' being a filter while actually
    implementing it as a regular selection option which adds to the
    processes to display.
    
    Reviewed by:    dch
    MFC after:      1 day
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D50193
---
 RELNOTES | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/RELNOTES b/RELNOTES
index 369ce0d9c504..49a4085214aa 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -15,6 +15,24 @@ Changes to this file should not be MFCed.
 	interfaces for viewing and manipulating audio device settings (sysctls,
 	/dev/sndstat), into a single utility with a similar control-driven
 	interface to that of mixer(8).
+
+93a94ce731a8:
+	ps(1)'s options '-a' and '-A', when combined with any other one
+	affecting the selection of processes except for '-X' and '-x', would
+	have no effect, in contradiction with the rule that one process is
+	listed as soon as any of the specified options selects it (inclusive
+	OR), which is both mandated by POSIX and arguably a natural expectation.
+	This bug has been fixed.
+
+	As a practical consequence, specifying '-a'/'-A' now causes all
+	processes to be listed regardless of other selection options (except for
+	'-X' and '-x', which still apply).  In particular, to list only
+	processes from specific jails, one must not use '-a' with '-J'.  Option
+	'-J', contrary to its apparent initial intent, never worked as a filter
+	in practice (except by accident with '-a' due to the bug), but instead
+	as any other selection options (e.g., '-U', '-p', '-G', etc.) subject to
+	the "inclusive OR" rule.
+
 995b690d1398:
 	ps(1)'s '-U' option has been changed to select processes by their real
 	user IDs instead of their effective one, in accordance with POSIX and