Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153327218
D49619.id153089.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D49619.id153089.diff
View Options
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();
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 12:19 PM (9 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31909901
Default Alt Text
D49619.id153089.diff (1 KB)
Attached To
Mode
D49619: ps(1): Match current user's processes using ps' effective UID
Attached
Detach File
Event Timeline
Log In to Comment