From owner-freebsd-stable Mon Sep 23 20:37:58 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F25937B401 for ; Mon, 23 Sep 2002 20:37:56 -0700 (PDT) Received: from bifrost.agrknives.com (bifrost.hos.net [204.251.33.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4EAC43E42 for ; Mon, 23 Sep 2002 20:37:55 -0700 (PDT) (envelope-from arussell@bifrost.agrknives.com) Received: from bifrost.agrknives.com (localhost.agrknives.com [127.0.0.1]) by bifrost.agrknives.com (8.12.5/8.12.4) with ESMTP id g8O3brnK056506; Mon, 23 Sep 2002 22:37:53 -0500 (CDT) (envelope-from arussell@bifrost.agrknives.com) Received: (from arussell@localhost) by bifrost.agrknives.com (8.12.5/8.12.2/Submit) id g8O3brWo056505; Mon, 23 Sep 2002 22:37:53 -0500 (CDT) Date: Mon, 23 Sep 2002 22:37:53 -0500 From: "Andrew G. Russell IV" To: Andrew Gordon Cc: FreeBSD Stable List Subject: Re: Weird uptime(1) output Message-ID: <20020923223753.A56477@bifrost.agrknives.com> References: <20020923033214.GB48084@wwweasel.geeksrus.net> <20020923110213.L2298-100000@server.arg.sj.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020923110213.L2298-100000@server.arg.sj.co.uk>; from arg-bsd@arg1.demon.co.uk on Mon, Sep 23, 2002 at 04:18:51PM +0100 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Not to rain on anybody, but a number of years ago (10?) SWBell gave IBM a lot of money to make this kind of thing work for security reasons, they were coming from async/x25 login of individual terminal, and IBM had to give the money back, I came up with a hack forcing user to login to pty's, but it worked just about as well as blinking on an Xstation... The KDE folks will find things break. If any wants to talk about it, I'll try and find my notes, but it was a nighmare... Cheers A.G. On Mon, Sep 23, 2002 at 04:18:51PM +0100, Andrew Gordon wrote: > On Sun, 22 Sep 2002, AlanE wrote: > > > I have discussed this with the KDE maintainer of kdm, and he states that > > he *wants* the utmp entry to be :0 (or :0.0, or whatever the DISPLAY > > is). While I disagree with that, it's kinda hard to get that information > > (the tty) to the script that makes the utmp entry. > > > 1) As someone else mentioned, this isn't a KDE problem. It's existed > for years with xdm and sessreg. I use the patch below to avoid the > error messages. > > 2) It isn't just "hard to get the tty name to the script", in the > general case there _is_ no tty name (think remote X terminals). > Only in the special case of an X server running locally is there > a tty name you can quote, and even there it's not useful > for the purposes of 'w', since the atime on the tty doesn't change > to reflect keyboard activity when it's in use by an X server. > > 3) This patch doesn't fix the problem, it just avoids it. > While it would be useful to have inactivity information about > X terminals, I can't see any way to get at it. Certainly, there > is nothing on the local machine that holds the information > (the user might be interacting with an application running on > another machine), so 'w' would need to ask the X server, and > I don't believe that a mechanism exists for it to do so. > > > --- usr.bin/w/w.c 12 Mar 2002 19:51:51 -0000 1.38.2.6 > +++ usr.bin/w/w.c 23 Sep 2002 15:00:45 -0000 > @@ -504,6 +504,12 @@ > static struct stat sb; > char ttybuf[MAXPATHLEN]; > > + if (line[0] == ':') { > + /* Assume an X login via sessreg */ > + time(&sb.st_atime); > + sb.st_rdev = -1; > + return (&sb); > + } > (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, > line); > if (stat(ttybuf, &sb)) { > warn("%s", ttybuf); > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message -- _______________________________________________________________________________ A.G. Russell IV KC5KFD The Knife Company e-mail: ag4@theknifecompany.com Phone 479-631-0055 FAX 479-631-8734 Old Klingon Saying -- 'oH majQa' yIn je bang, Qo' bang ------------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message