summaryrefslogtreecommitdiffstats
path: root/openbsd
diff options
context:
space:
mode:
authorSilke Hofstra <silke@slxh.eu>2021-08-16 22:50:36 +0200
committerBenBE <BenBE@geshi.org>2021-10-27 21:20:59 +0200
commit696f79fe5099d510fc6ecc6d1e2f0ab3ae29e04e (patch)
tree2c9fa20e121b5c4b6cb90072fa016e5a642ddb65 /openbsd
parent4374a267bec655e704faaa379d1ed62eca90b71a (diff)
Dynamically scale the ST_UID size to support 32-bit UIDs
While most Unix-like systems use 16-bit user IDs, Linux supports 32-bit UIDs since version 2.6. UIDs above 65535 are used for UID namespacing of containers, where a container has its own set of 16-bit user IDs. Processes in such containers will have (much) larger UIDs than 65535. Because the current format strings for `ST_UID` and `USER` are `%5d` and `%9d` respectively, processes with such UIDs lead to misaligned columns. Dynamically scale the `ST_UID` column and increase the size of `USER` to 10 characters (length of UINT32_MAX) to ensure that the user ID always fits. Additionally: clean up how the titlebuffer size calculation and ensure the PID column has a minimum size of 5.
Diffstat (limited to 'openbsd')
-rw-r--r--openbsd/OpenBSDProcess.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
index 52dcb0e6..fe9018d2 100644
--- a/openbsd/OpenBSDProcess.c
+++ b/openbsd/OpenBSDProcess.c
@@ -136,7 +136,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
},
[ST_UID] = {
.name = "ST_UID",
- .title = " UID ",
+ .title = "UID",
.description = "User ID of the process owner",
.flags = 0,
},
@@ -163,7 +163,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
},
[USER] = {
.name = "USER",
- .title = "USER ",
+ .title = "USER ",
.description = "Username of the process owner (or user ID if name cannot be determined)",
.flags = 0,
},

© 2014-2024 Faster IT GmbH | imprint | privacy policy