diff options
author | jbeck <none@none> | 2007-04-24 17:25:22 -0700 |
---|---|---|
committer | jbeck <none@none> | 2007-04-24 17:25:22 -0700 |
commit | a5682f5243c3b36a55009c52d62edab683b28ccf (patch) | |
tree | edbead82ec811c3dd0f7ae99b873452e07082ba2 /usr/src/cmd/cmd-inet/lib/nwamd/util.c | |
parent | 11a41203dd28e5381e00564eae568c60257e916e (diff) | |
download | illumos-gate-a5682f5243c3b36a55009c52d62edab683b28ccf.tar.gz |
6547152 nwamd can't find graphical console user under gdm
Diffstat (limited to 'usr/src/cmd/cmd-inet/lib/nwamd/util.c')
-rw-r--r-- | usr/src/cmd/cmd-inet/lib/nwamd/util.c | 8 |
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); |