diff --git a/UPDATING b/UPDATING --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,13 @@ world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250403: + ps(1)'s default list of processes now comes from matching its effective + user ID instead of its real user ID with the effective user ID of all + processes, in accordance with POSIX. As ps(1) itself is not installed + setuid, this only affects processes having different real and effective + user IDs that launch ps(1) processes. + 20250314: We now use LLVM's binary utilities (nm, objcopy, etc.) by default. The WITHOUT_LLVM_BINUTILS src.conf(5) knob can be used to revert to diff --git a/bin/ps/ps.c b/bin/ps/ps.c --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -503,13 +503,14 @@ */ 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"); + /* + * Default is to request our processes only. As per POSIX, we + * match processes by their effective user IDs and we use our + * effective user ID as our own identity. + */ + expand_list(&uidlist); + *uidlist.l.uids = geteuid(); nselectors = 1; - uidlist.count = uidlist.maxcount = 1; - *uidlist.l.uids = getuid(); } /*