Opened 12 years ago

Closed 12 years ago

#8995 closed bug (fixed)

ps displays incorrect uid and gid

Reported by: Prasad Owned by: leavengood
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/Development
Keywords: ps command Cc: prasadjoshi.linux@…
Blocked By: Blocking:
Platform: All

Description

ps output completely ignores the uid and gid of the process.

For example:

~> id
uid=0(user) gid=0(root) groups=0(root)

~> ps
Team                                                  Id #Threads  Gid  Uid
...
...
/bin/bash -l                                         205        1    0    0
/bin/ps                                              228        1    0    0

~> useradd -s /bin/bash -n "Prasad Joshi" prasad
password for user: 
repeat password: 

~> su - prasad

Welcome to the Haiku shell.

~> ps
Team                                                  Id #Threads  Gid  Uid
...
...
/boot/system/apps/Terminal                           201        4    0    0
/bin/bash -l                                         205        1    0    0
/bin/bash                                            231        1    0    0
/bin/ps                                              250        1    0    0

~> id
uid=1000(prasad) gid=100(users) groups=100(users)

Here is gid and uid of the process 231 should have been 100 and 1000 respectively.

Attachments (1)

0001-ps-fix-uid-and-gid-in-the-ps-output.patch (2.5 KB ) - added by Prasad 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Prasad, 12 years ago

patch: 01

comment:2 by Prasad, 12 years ago

After applying the attached patch

~> su - prasad

Welcome to the Haiku shell.

~> id
uid=1000(prasad) gid=100(users) groups=100(users)

~> ps
Team                                                  Id #Threads  Gid  Uid
kernel_team                                            1       36    0    0
/bin/sh /boot/system/boot/Bootscript                  36        1    0    0
/boot/system/servers/registrar                        53        7    0    0
/boot/system/servers/debug_server                     58        2    0    0
/boot/system/servers/net_server                       61        4    0    0
/boot/system/servers/app_server                       62       33    0    0
/boot/system/servers/syslog_daemon                    77        2    0    0
/boot/system/servers/input_server                     89        9    0    0
/boot/system/servers/mount_server                    100        1    0    0
/boot/system/Tracker                                 114        8    0    0
/boot/system/Deskbar                                 115        5    0    0
/boot/system/servers/media_server                    116        6    0    0
/boot/system/servers/midi_server                     117        3    0    0
/boot/system/servers/print_server                    118        2    0    0
/boot/system/servers/cddb_daemon                     120        1    0    0
/boot/system/servers/notification_server             121        2    0    0
/boot/system/servers/power_daemon                    122        1    0    0
/boot/system/servers/media_addon_server              156        8    0    0
/boot/system/apps/Terminal                           225        4    0    0
/bin/bash -l                                         232        1    0    0
/bin/bash                                            286        1  100 1000
/boot/apps/Pe/Pe                                     372        5    0    0
/bin/mimeset -f /boot/system/documentation           373        1    0    0
/bin/ps                                              397        1  100 1000

~> ps -a
---------------------------------------------------------------------------
Team                                                  Id #Threads  Gid  Uid
/bin/bash -l                                         232        1    0    0

Thread                                   Id    State Prio    UTime    KTime
bash                                    232     wait   10      116     1000 
---------------------------------------------------------------------------
Team                                                  Id #Threads  Gid  Uid
/bin/bash                                            286        1  100 1000

Thread                                   Id    State Prio    UTime    KTime
bash                                    286     wait   10      183     1483 
---------------------------------------------------------------------------
Team                                                  Id #Threads  Gid  Uid
/bin/sh /boot/common/boot/post_install/mime_update.sh   320        1    0    0

Thread                                   Id    State Prio    UTime    KTime
sh                                      320     wait   10       84      880 
---------------------------------------------------------------------------
Team                                                  Id #Threads  Gid  Uid
/bin/ps -a                                           403        1  100 1000

Thread                                   Id    State Prio    UTime    KTime
ps                                      403      run   10       13      204 
---------------------------------------------------------------------------

comment:3 by anevilyak, 12 years ago

Component: Applications/TerminalApplications/Command Line Tools
Owner: changed from jackburton to nobody
Version: R1/alpha3R1/Development

comment:4 by leavengood, 12 years ago

Owner: changed from nobody to leavengood
Status: newin-progress

Taking ownership.

comment:5 by leavengood, 12 years ago

Resolution: fixed
Status: in-progressclosed

Patch applied in hrev44677. Thanks again!

Note: See TracTickets for help on using tickets.