Bug 88981
Summary: | "ps" does not consistently translate UIDs to usernames against NIS users | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Ross Becker <rbecker> | ||||
Component: | procps | Assignee: | Daniel Walsh <dwalsh> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 7.2 | CC: | bhaslinux | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2004-02-11 13:25:55 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Ross Becker
2003-04-15 23:05:22 UTC
I think the problem is the length of the username. If the username is longer than the column, ps prints the uid instead of a truncated username. What Alexander Larsson has stated is right. I am also facing the same problem with usernames > 8 chars FIX: --------------------------------------------------- File: output.c The rightward variable stores the value and limits to 8 Suppose i had 9 chars ( as in bhaslinux ) then i added 1 to it which makes it print things properly ---- 1616 if (fmt->next) 1617 max_rightward = fmt->width + 1; 1618 else 1619 max_rightward = active_cols - camax + 1; ---- (please see added '1' to it Result after this correction ---- [bhaslinux@bhaslinux ps]$ ./ps -f UID PID PPID C STIME TTY TIME CMD bhaslinux 30470 30469 0 11:45 pts/4 00:00:00 bash bhaslinux 30500 30470 0 11:45 pts/4 00:00:00 ./ps -f Result before correction ( using /bin/ps ) ---- UID PID PPID C STIME TTY TIME CMD 500 30470 30469 0 11:45 pts/4 00:00:00 bash 500 30501 30470 0 11:45 pts/4 00:00:00 ps -f The final work to be done will be to either remove the cols check in the line (omit the (strlen(pp->euser) > max_rightward) check like ---- 527 pr_euser(void) 528 { 529 if (user_is_number || (strlen(pp->euser) > max_rightward) which will be a nasty fix OR run through the password file and get the max_rightward as the length of the username with maximum chars But removing the check will be fine as there are very few people who will like have extensively long usernames and most of the organizations prefer to stop with 8 chars. Bhasker C V bhaslinux Created attachment 96600 [details]
Patch for output.c file
Apply this patch to procps-2.0.11 output.c
This will truncate the username to 8chars and then display the
username instead of printing the UIDs of the users
Fixed in current release |