Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2002 13:11:17 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Michael Wardle <michael@endbracket.net>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/35769: w does not correctly interpret X sessions
Message-ID:  <15500.62277.345549.397192@grasshopper.cs.duke.edu>
In-Reply-To: <200203111310.g2BDA1o82347@freefall.freebsd.org>
References:  <200203111310.g2BDA1o82347@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Michael Wardle writes:
 > The following reply was made to PR bin/35769; it has been noted by GNATS.
 > 
 > From: Michael Wardle <michael@endbracket.net>
 > To: "Crist J. Clark" <cjc@FreeBSD.ORG>
 > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15500.62277.345549.397192>