mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
ps(1): Make '-a' and '-A' always show all processes
When combined with other options affecting the selection of processes, except for '-X' and '-x', option '-a' would have no effect (and '-A' would reduce to just '-x'). This was in contradiction with the rule applying to all other selection options stating that one process is listed as soon as any of these options has been specified and selects it, which is both mandated by POSIX and arguably a natural expectation. MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49617 (code) Differential Revision: https://reviews.freebsd.org/D49618 (manual page)
This commit is contained in:
parent
5dad61d9b9
commit
93a94ce731
2 changed files with 11 additions and 23 deletions
25
bin/ps/ps.1
25
bin/ps/ps.1
|
|
@ -78,7 +78,7 @@ and
|
|||
.Fl x
|
||||
options.
|
||||
Except for options
|
||||
.Fl A , a , X ,
|
||||
.Fl X
|
||||
and
|
||||
.Fl x ,
|
||||
as soon as one of them appears, it inhibits the default process selection, i.e.,
|
||||
|
|
@ -213,11 +213,6 @@ see
|
|||
and
|
||||
.Fl x
|
||||
.Pc .
|
||||
Currently, this option has no effect if any other option selecting processes to
|
||||
display is present, except for
|
||||
.Fl X
|
||||
and
|
||||
.Fl x .
|
||||
If the
|
||||
.Va security.bsd.see_other_uids
|
||||
sysctl is set to zero, this option is honored only if the real user ID of the
|
||||
|
|
@ -965,13 +960,13 @@ which is the current behavior of option
|
|||
.Pc .
|
||||
.Pp
|
||||
However, options
|
||||
.Fl G , l , o , p ,
|
||||
.Fl A , a , G , l , o , p ,
|
||||
and
|
||||
.Fl t
|
||||
behave as prescribed by
|
||||
.St -p1003.1-2024 .
|
||||
Options
|
||||
.Fl A , a , f , U ,
|
||||
.Fl f , U ,
|
||||
and
|
||||
.Fl w
|
||||
currently do not, but may be changed to in the future.
|
||||
|
|
@ -1021,20 +1016,6 @@ implementation (for other BSDs, illumos or Linux) behaves like this.
|
|||
For all these reasons, the behavior is expected to be changed soon to using the
|
||||
effective user ID instead.
|
||||
.Pp
|
||||
The
|
||||
.Fl a
|
||||
option has no effect if other options affecting the selection of processes are
|
||||
used, except for (non-)filters
|
||||
.Fl X
|
||||
and
|
||||
.Fl x.
|
||||
Option
|
||||
.Fl A
|
||||
has the same restriction.
|
||||
This idiosyncrasy is both in contradiction with
|
||||
.St -p1003.1-2024
|
||||
and arguably with common sense, and is expected to be removed soon.
|
||||
.Pp
|
||||
.Nm ps
|
||||
currently does not correctly limit the ouput width, and in most cases does not
|
||||
limit it at all when it should.
|
||||
|
|
|
|||
|
|
@ -503,7 +503,14 @@ main(int argc, char *argv[])
|
|||
free(keywords_info);
|
||||
keywords_info = NULL;
|
||||
|
||||
if (!all && nselectors == 0) {
|
||||
if (all)
|
||||
/*
|
||||
* We have to display all processes, regardless of other
|
||||
* options.
|
||||
*/
|
||||
nselectors = 0;
|
||||
else if (nselectors == 0) {
|
||||
/* Default is to request our processes only. */
|
||||
uidlist.l.ptr = malloc(sizeof(uid_t));
|
||||
if (uidlist.l.ptr == NULL)
|
||||
xo_errx(1, "malloc failed");
|
||||
|
|
|
|||
Loading…
Reference in a new issue