[Bug 287980] ps(1) ignores -U userid parameter, always show all processes

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 03 Jul 2025 09:06:57 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287980

            Bug ID: 287980
           Summary: ps(1) ignores -U userid parameter, always show all
                    processes
           Product: Base System
           Version: 14.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: girgen@FreeBSD.org

There's a release note [1] for FreeBSD-14.3

Fix -U flag of ps(1) to select processes by real user IDs. This is what POSIX
mandates for option -U and arguably the behavior that most users actually need
in most cases. Before, -U would select processes by their effective user IDs
(which is the behavior mandated by POSIX for option -u). a2132d91739d.
(Sponsored by The FreeBSD Foundation).

I assume this is the culprit for the changed behaviour:

$ ps axU girgen|wc -l
      76
$ ps axU root|wc -l  
      76
$ ps ax|wc -l      
      76
$ freebsd-version 
14.3-RELEASE

Compare to 14.2:

$ ps axU girgen | wc -l 
       7
$ ps axU root | wc -l 
      58
$ ps ax | wc -l  
      70
$ freebsd-version 
14.2-RELEASE-p2

which is more in line with what's expected.

Hence, ps now simply ignores the -U parameter. This must surely be a mistake?
I'm well aware that is how Linux behaves, but *that* is surely just a flaw as
well?

[1] https://www.freebsd.org/releases/14.3R/relnotes/

-- 
You are receiving this mail because:
You are the assignee for the bug.