From owner-freebsd-bugs Mon Mar 11 10:11:53 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 484ED37B400 for ; Mon, 11 Mar 2002 10:11:48 -0800 (PST) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id NAA02361; Mon, 11 Mar 2002 13:11:47 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g2BIBHM95922; Mon, 11 Mar 2002 13:11:17 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15500.62277.345549.397192@grasshopper.cs.duke.edu> Date: Mon, 11 Mar 2002 13:11:17 -0500 (EST) To: Michael Wardle Cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/35769: w does not correctly interpret X sessions In-Reply-To: <200203111310.g2BDA1o82347@freefall.freebsd.org> References: <200203111310.g2BDA1o82347@freefall.freebsd.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Michael Wardle writes: > The following reply was made to PR bin/35769; it has been noted by GNATS. > > From: Michael Wardle > To: "Crist J. Clark" > Cc: freebsd-gnats-submit@FreeBSD.ORG > Subject: Re: bin/35769: w does not correctly interpret X sessions > Date: Mon, 11 Mar 2002 05:09:30 -0800 (PST) > > [...] > > > What does 'tty' return for one of these sessions? > > This is precisely the problem -- it is not a terminal, indeed there is > no way to issue "tty". I can only issue "tty" if I start a terminal > emulator, but the problem is when w tries to look directly at the X > session itself, not any terminal I have spawned from within the X > session. The problem is that kdm (and perhaps other things) are spamming utmp with non-dev entries, such as ":0". Eg: Breakpoint 5, 0x480dcd47 in fprintf () from /usr/lib/libc.so.4 (gdb) where #0 0x480dcd47 in fprintf () from /usr/lib/libc.so.4 #1 0x480b083e in vwarnc () from /usr/lib/libc.so.4 #2 0x480b0791 in warn () from /usr/lib/libc.so.4 #3 0x804a0e8 in ttystat (line=0x804caa0 ":0", sz=8) at w.c:500 #4 0x8049558 in main (argc=1, argv=0xbfbff7e8) at w.c:214 #5 0x8048e25 in _start () (gdb) frame 3 #3 0x804a0e8 in ttystat (line=0x804caa0 ":0", sz=8) at w.c:500 500 warn("%s", ttybuf); (gdb) l 495 static struct stat sb; 496 char ttybuf[MAXPATHLEN]; 497 498 (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line); 499 if (stat(ttybuf, &sb)) { 500 warn("%s", ttybuf); 501 return (NULL); 502 } 503 return (&sb); 504 } (gdb) p line $1 = 0x804caa0 ":0" I'm certain that kdm is one of the programs doing this, because I noticed this on my wife's desktop just after I setup kdm on it. Perhaps we should check an exclusion list consisting of the various things that login managers spam utmp with & not warn for them. Or, better yet, we could patch the loging managers to not spam utmp.. Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message