From 201dfd8f646ceb1d056c536765c882333c5b6921 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 29 Nov 2005 17:35:24 +0000
Subject: [PATCH] svn merge -r6689:6713
 https://eris.llnl.gov/svn/slurm/branches/slurm-0-6-branch

---
 NEWS              |  5 +++++
 src/sacct/sacct.c | 12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index e91b148ea50..99d605d2a37 100644
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,11 @@ documents those changes that are of interest to users and admins.
  -- Some infrastructure added for task launch controls (slurm.conf:
     TaskProlog, TaskEpilog, TaskPlugin; srun --task-prolog, --task-epilog).
 
+* Changes in SLURM 0.6.10
+=========================
+ -- Sacct bug fixes: Report correct user name for job step, show "uid.gid"
+    as fifth field of job step record (Andy Riebs, slurm.hp.sacct_uid.patch).
+
 * Changes in SLURM 0.6.9
 ========================
  -- Fix bug in mpi plugin to set the ID correctly
diff --git a/src/sacct/sacct.c b/src/sacct/sacct.c
index 2d6a22b67e5..a2dfb7e3a37 100644
--- a/src/sacct/sacct.c
+++ b/src/sacct/sacct.c
@@ -898,7 +898,7 @@ void doFdump(char* fields[])
 		{ "partition",	"partition",	"partition" },	/*  1 */
 		{ "submitted",	"submitted",	"submitted" },	/*  2 */
 		{ "starttime",	"starttime",	"starttime" },	/*  3 */
-		{ "uid.gid",	"reserved-2",	"uid.gid" },	/*  4 */
+		{ "uid.gid",	"uid.gid",	"uid.gid" },	/*  4 */
 		{ "reserved-1",	"reserved-1",	"reserved-1" },	/*  5 */
 		{ "recordType", "recordType",	"recordType" },	/*  6 */
 		{ "recordVers",	"recordVers",	"recordVers" },	/*  7 */
@@ -2564,7 +2564,6 @@ void printUser(print_what_t which, long idx)
 			printf("%-9s", "---------");
 			break;
 		case JOB:
-		case JOBSTEP:
 			{
 				char	*tmp="(unknown)";
 				struct	passwd *pw;
@@ -2573,6 +2572,15 @@ void printUser(print_what_t which, long idx)
 				printf("%-9s", tmp);
 			}
 			break;
+		case JOBSTEP:
+			{
+				char	*tmp="(unknown)";
+				struct	passwd *pw;
+				if ((pw=getpwuid(jobs[jobsteps[idx].j].uid)))
+					tmp=pw->pw_name;
+				printf("%-9s", tmp);
+			}
+			break;
 	} 
 }
 
-- 
GitLab