summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/cmd-inet/lib/nwamd/util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/src/cmd/cmd-inet/lib/nwamd/util.c b/usr/src/cmd/cmd-inet/lib/nwamd/util.c
index 31198df801..c3a3eb740e 100644
--- a/usr/src/cmd/cmd-inet/lib/nwamd/util.c
+++ b/usr/src/cmd/cmd-inet/lib/nwamd/util.c
@@ -270,11 +270,15 @@ valid_graphical_user(boolean_t query)
/*
* Look for someone logged into the console from host ":0" (i.e.,
* the X display. Down the road, we should generalize this so
- * ":0" is not hard-coded.
+ * ":0" is not hard-coded. Note that the entry we want is usually
+ * an ordinary user process but sometimes if a session leader has
+ * exited, it can come from a DEAD_PROCESS, as is known to happen
+ * when the user logs in via gdm(1m).
*/
setutxent();
while ((utp = getutxent()) != NULL) {
- if ((utp->ut_type == USER_PROCESS) &&
+ if (((utp->ut_type == USER_PROCESS) ||
+ (utp->ut_type == DEAD_PROCESS)) &&
(strcmp(utp->ut_line, "console") == 0) &&
(strcmp(utp->ut_host, ":0") == 0)) {
user = strdup(utp->ut_user);