From jr@opal.com  Mon Nov  5 03:08:33 2007
Return-Path: <jr@opal.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E02B16A417
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Nov 2007 03:08:33 +0000 (UTC)
	(envelope-from jr@opal.com)
Received: from smtp.vzavenue.net (smtp.vzavenue.net [66.171.59.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F10713C4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Nov 2007 03:08:33 +0000 (UTC)
	(envelope-from jr@opal.com)
Received: from 98.79.171.66.subscriber.vzavenue.net (HELO homobox.opal.com) ([66.171.79.98])
  by smtp.vzavenue.net with ESMTP; 04 Nov 2007 21:49:24 -0500
Received: from linwhf.opal.com (localhost [127.0.0.1])
	by homobox.opal.com (8.13.8/8.13.8) with ESMTP id lA52nNjC038276
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 4 Nov 2007 21:49:23 -0500 (EST)
	(envelope-from jr@opal.com)
Received: from linwhf.opal.com ([192.168.3.65] helo=linwhf.opal.com) by
	ASSP-nospam; 4 Nov 2007 21:49:23 -0500
Received: from linwhf.opal.com (localhost [127.0.0.1])
	by linwhf.opal.com (8.14.1/8.14.1) with ESMTP id lA4LEV9i004364
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 4 Nov 2007 16:14:31 -0500 (EST)
	(envelope-from jr@linwhf.opal.com)
Received: (from jr@localhost)
	by linwhf.opal.com (8.14.1/8.14.1/Submit) id lA4LEVGY004363;
	Sun, 4 Nov 2007 16:14:31 -0500 (EST)
	(envelope-from jr)
Message-Id: <200711042114.lA4LEVGY004363@linwhf.opal.com>
Date: Sun, 4 Nov 2007 16:14:31 -0500 (EST)
From: "J.R. Oldroyd" <fbsd@opal.com>
Reply-To: "J.R. Oldroyd" <fbsd@opal.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: who(1) no longer displays entries for folk logged in from xdm(1)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         117830
>Category:       bin
>Synopsis:       [patch] who(1) no longer displays entries for folk logged in from xdm(1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 05 03:10:01 UTC 2007
>Closed-Date:    
>Last-Modified:  Fri Nov 02 20:47:27 UTC 2012
>Originator:     J.R. Oldroyd
>Release:        FreeBSD 7.0-BETA1 i386
>Organization:
>Environment:
System: FreeBSD linwhf.opal.com 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Thu Nov 1 14:21:03 EDT 2007 xx:/usr/src/sys/i386/compile/LINWHF i386
>Description:
When logging in from xdm(1), utmp entries with a ttyname of ":0", ":1", ...
are made by an invocation of sessreg(1) in /usr/local/lib/X11/xdm/Xstartup.
who(1) does not display these entries.  "who -q", however, does.
>How-To-Repeat:
Run xdm.  Log in.  Start a shell.  Run "who".
>Fix:
--- src/usr.bin/who/who.orig	2007-10-29 14:44:55.000000000 -0400
+++ src/usr.bin/who/who.c	2007-11-03 12:52:57.000000000 -0400
@@ -225,7 +225,7 @@
 	while (fread(&ut, sizeof(ut), 1, fp) == 1) {
 		if (*ut.ut_name == '\0')
 			continue;
-		if (ttystat(ut.ut_line, UT_LINESIZE) != 0)
+		if (*ut.ut_line != ':' && ttystat(ut.ut_line, UT_LINESIZE) != 0)
 			continue;
 		row(&ut);
 	}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: matteo 
State-Changed-When: Ven 21 Nov 2008 02:49:33 UTC 
State-Changed-Why:  
Mark this PR as suspended: I think the problem actually resides in how xdm  
registers the session in utmp. This is done by the command sessreg in  
/usr/local/lib/X11/xdm/Xstartup. Instead of using -l $DISPLAY -h "", I suggest 
using just -h $DISPLAY (no -l), so that xdm behaves like gdm does and adds a  
more invormative entry in utmp. 
Just in case we want to reopen this PR: Notice that w(1) is affected too. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117830 
State-Changed-From-To: suspended->open 
State-Changed-By: eadler 
State-Changed-When: Fri Nov 2 20:47:26 UTC 2012 
State-Changed-Why:  
while this is an application bug; we can support these entries without 
harm so we should 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117830 
>Unformatted:
