[haiku-commits] haiku: hrev44677 - in src: bin system/kernel

  • From: leavengood@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 3 Oct 2012 21:47:52 +0200 (CEST)

hrev44677 adds 1 changeset to branch 'master'
old head: 4fd62caa9acc437534c41bbb7d3fc9d53e915005
new head: 45132e2b226dd9a957e6f5446bd7a2603d4c0701

----------------------------------------------------------------------------

45132e2: ps: fix uid and gid in the ps output
  
  The function fill_team_info() completely ignored the user id and the
  group id of the process (fields info->uid and info->gid respectively).
  Since the info structure was zeroed earlier, the ps output showed uid
  and gid of each process equal to zero.
  
  The patch fixes the problem by properly initializing the members with
  effective uid and gid. Now the output is correct.
  
  Fixes #8995.
  
  Signed-off-by: Ryan Leavengood <leavengood@xxxxxxxxx>

                              [ Prasad Joshi <prasadjoshi.linux@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44677
Commit:      45132e2b226dd9a957e6f5446bd7a2603d4c0701
URL:         http://cgit.haiku-os.org/haiku/commit/?id=45132e2
Author:      Prasad Joshi <prasadjoshi.linux@xxxxxxxxx>
Date:        Mon Sep 17 16:34:09 2012 UTC
Committer:   Ryan Leavengood <leavengood@xxxxxxxxx>
Commit-Date: Wed Oct  3 19:45:56 2012 UTC

Ticket:      https://dev.haiku-os.org/ticket/8995

----------------------------------------------------------------------------

2 files changed, 3 insertions(+), 3 deletions(-)
src/bin/ps.c               |    2 +-
src/system/kernel/team.cpp |    4 ++--

----------------------------------------------------------------------------

diff --git a/src/bin/ps.c b/src/bin/ps.c
index 92416ce..bc5fb07 100644
--- a/src/bin/ps.c
+++ b/src/bin/ps.c
@@ -29,7 +29,7 @@ printTeamInfo(team_info *teamInfo, bool printHeader)
                        "Uid");
                
        printf("%-50s %5ld %8ld %4d %4d\n", teamInfo->args, teamInfo->team,
-               teamInfo->thread_count, teamInfo->uid, teamInfo->gid);
+               teamInfo->thread_count, teamInfo->gid, teamInfo->uid);
 }
 
 
diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp
index b794b07..62a3677 100644
--- a/src/system/kernel/team.cpp
+++ b/src/system/kernel/team.cpp
@@ -2494,8 +2494,8 @@ fill_team_info(Team* team, team_info* info, size_t size)
        //info->area_count =
        info->debugger_nub_thread = team->debug_info.nub_thread;
        info->debugger_nub_port = team->debug_info.nub_port;
-       //info->uid =
-       //info->gid =
+       info->uid = team->effective_uid;
+       info->gid = team->effective_gid;
 
        strlcpy(info->args, team->Args(), sizeof(info->args));
        info->argc = 1;


Other related posts:

  • » [haiku-commits] haiku: hrev44677 - in src: bin system/kernel - leavengood