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 <[email protected]>
This commit is contained in:
Prasad Joshi
2012-10-03 15:45:56 -04:00
committed by Ryan Leavengood
parent 4fd62caa9a
commit 45132e2b22
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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);
}
+2 -2
View File
@@ -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;