Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2011 16:20:29 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226841 - head/usr.bin/getent
Message-ID:  <201110271620.p9RGKTa4014544@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Thu Oct 27 16:20:29 2011
New Revision: 226841
URL: http://svn.freebsd.org/changeset/base/226841

Log:
  Print INIT_PROCESS and LOGIN_PROCESS entries as well.
  
  Even though our implementation of utmpx never emits these types of
  records, they are part of POSIX. Do print them when they show up in the
  database files.
  
  While there, also print the type number of unsupported records.

Modified:
  head/usr.bin/getent/getent.c

Modified: head/usr.bin/getent/getent.c
==============================================================================
--- head/usr.bin/getent/getent.c	Thu Oct 27 16:12:25 2011	(r226840)
+++ head/usr.bin/getent/getent.c	Thu Oct 27 16:20:29 2011	(r226841)
@@ -600,13 +600,24 @@ utmpxprint(const struct utmpx *ut)
 		printf("\" pid=\"%d\" user=\"%s\" line=\"%s\" host=\"%s\"\n",
 		    ut->ut_pid, ut->ut_user, ut->ut_line, ut->ut_host);
 		break;
+	case INIT_PROCESS:
+		printf("init process: id=\"");
+		UTMPXPRINTID;
+		printf("\" pid=\"%d\"\n", ut->ut_pid);
+		break;
+	case LOGIN_PROCESS:
+		printf("login process: id=\"");
+		UTMPXPRINTID;
+		printf("\" pid=\"%d\" user=\"%s\" line=\"%s\" host=\"%s\"\n",
+		    ut->ut_pid, ut->ut_user, ut->ut_line, ut->ut_host);
+		break;
 	case DEAD_PROCESS:
 		printf("dead process: id=\"");
 		UTMPXPRINTID;
 		printf("\" pid=\"%d\"\n", ut->ut_pid);
 		break;
 	default:
-		printf("unknown record type\n");
+		printf("unknown record type %hu\n", ut->ut_type);
 		break;
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110271620.p9RGKTa4014544>