Bug 143989 - RHEL3: Problem with big UIDs in ps
RHEL3: Problem with big UIDs in ps
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: procps (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Brian Brock
:
Depends On:
Blocks: 132991
  Show dependency treegraph
 
Reported: 2005-01-03 08:51 EST by Hannu Martikka
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-19 23:25:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix the big UID problem on ps-command. (1.73 KB, patch)
2005-01-03 08:54 EST, Hannu Martikka
no flags Details | Diff

  None (edit)
Description Hannu Martikka 2005-01-03 08:51:39 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040928

Description of problem:
Ps-command has problem with big UIDs. 
If the last 16 bits of the UIDs are the same (for example 3663 and
10161742) then output of the ps-command will report processes of both
users.

Version-Release number of selected component (if applicable):
procps-2.0.17-13

How reproducible:
Always

Steps to Reproduce:

# adduser -u 10161742 biguid
# adduser -u 3662 smalluid

# su - biguser
$ ps -fu biguid
UID        PID  PPID  C STIME TTY          TIME CMD
biguid    6535  6534  0 19:24 pts/7    00:00:00 -bash
biguid    6643  6535  0 19:24 pts/7    00:00:00 ps -fu biguid

(open new window/terminal)
# su - smalluid

$ ps -fu biguid
UID        PID  PPID  C STIME TTY          TIME CMD
biguid    6535  6534  0 19:24 pts/7    00:00:00 -bash
smalluid  6645  6644  1 19:24 pts/8    00:00:00 -bash
biguid    6688  6535  0 19:25 pts/7    00:00:00 ps -fu biguid

$ ps -fu 3662
UID        PID  PPID  C STIME TTY          TIME CMD
biguid    3605  3604  0 15:37 pts/0    00:00:00 -bash
smalluid  3746  3745  0 15:37 pts/1    00:00:00 -bash
biguid    3921  3605  0 15:44 pts/0    00:00:00 ps -fu 3662

$ ps -fu smalluid n
     UID   PID  PPID  C STIME TTY      STAT   TIME CMD
10161742  3605  3604  0 15:37 pts/0    S      0:00 -bash
    3662  3746  3745  0 15:37 pts/1    S      0:00 -bash
10161742  3906  3605  0 15:43 pts/0    R      0:00 ps -fu smalluid n


Additional info:
Comment 1 Hannu Martikka 2005-01-03 08:54:47 EST
Created attachment 109255 [details]
Patch to fix the big UID problem on ps-command.
Comment 2 Karel Zak 2005-01-03 09:24:30 EST
Thanks for patch! I think it's useful for the latest procps version too.

The other bad thing is that libproc (in the latest version too) uses
"int" type for uid/gid in proc_t. I think it should be follow system
types and uses same types as stat(2).
Comment 3 Karel Zak 2005-01-05 03:13:46 EST
In CVS prepared for RHEL3-U5.
Comment 4 Albert Cahalan 2005-01-05 14:21:38 EST
Data types are pretty much determined by the sprintf() used
in kernel code to create the proc file.

There is no sprintf or sscanf code for uid_t or gid_t.
Maybe this is why Java eliminated typedef. :-)
Comment 5 Karel Zak 2005-01-06 04:16:03 EST
The problem was that in the old procps versions you can found
"unsigned short" cast for uid/gid data. I the new versions is there
used "unsigned" -- that is better.
Comment 6 Dennis Gregorovic 2005-05-19 23:25:50 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-156.html

Note You need to log in before you can comment on or make changes to this bug.