summaryrefslogtreecommitdiffstats
path: root/usr.bin/getent
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-10-27 16:20:29 +0000
committered <ed@FreeBSD.org>2011-10-27 16:20:29 +0000
commitc59a6ed6df861a12559948d484e8a3399492ff29 (patch)
treec0a7396a3e02c2d0408dee52802f78ae6c46495f /usr.bin/getent
parent247ca8dfcf95294d80df440016f87461f7709499 (diff)
downloadFreeBSD-src-c59a6ed6df861a12559948d484e8a3399492ff29.zip
FreeBSD-src-c59a6ed6df861a12559948d484e8a3399492ff29.tar.gz
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.
Diffstat (limited to 'usr.bin/getent')
-rw-r--r--usr.bin/getent/getent.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/getent/getent.c b/usr.bin/getent/getent.c
index 0459cca..85857d8 100644
--- a/usr.bin/getent/getent.c
+++ b/usr.bin/getent/getent.c
@@ -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;
}
}
OpenPOWER on IntegriCloud