Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!apple!anise.acc.com!pst From: pst@anise.acc.com (Paul Traina) Newsgroups: comp.windows.x Subject: Re: Why does every xterm create an entry in /usr/utmp? Message-ID: <1989Sep6.174824.10198@anise.acc.com> Date: 6 Sep 89 17:48:24 GMT References: <3472@blake.acs.washington.edu> Organization: Advanced Computer Communications, Santa Barbara, California Lines: 62 jkh@meepmeep.pcs.com (Jordan K. Hubbard) writes: >Hang on just a minute here. This is NOT a bug, or a "hack to fix finger" >as most people seem to be implying. There are a number of unix utilities >that expect every tty (or pty) to have a utmp entry associated with it. Exactly! The bug is in finger, not xterm. However, I have fixed (to my satisfaction) said bug. I have modified finger so that on long displays (e.g. "finger -l" or "finger pst" as opposed to "finger"), it will only show one instance of the user logged in: anise-[root-1> finger Login Name TTY Idle When Office pst Paul Traina p1 1:20 Wed 09:20 963-9431 x243 pst Paul Traina p0 Wed 09:20 963-9431 x243 pst Paul Traina p2 Wed 09:20 963-9431 x243 anise-[root-2> finger pst Login name: pst In real life: Paul Traina Phone: 963-9431 x243, 569-2158 (home) Directory: /home/pst Shell: /bin/tcsh On since Sep 6 09:20:14 on ttyp2 Project: Kernel munging for fun and profit. No Plan. This allows someone to see how many times (and where) users are logged in, but doesn't give them 23000 copies of the user's plan file and all the rest of the junk that comes along with a long finger display. Here's the fix, it's not pretty, it's not efficient, but it does the job with the fewest code changes. -- in route print(), add the following two lines after the other variable definitions: register struct person *q; register long minidle; -- in routine print(), look for the for loop and add the *'ed lines: for (p = person1; p != 0; p = p->link) { if (!unquick) { quickprint(p); continue; } if (!unshort) { shortprint(p); continue; } * for (q = person1, minidle = 32767; q != 0; q = q->link) * if (!strcmp(q->name, p->name)) * minidle = min(minidle, q->idletime); * if (p->idletime > minidle) * continue; personprint(p); Instant fixed finger. -- Reclaim those words you're afraid of. There's nothing wrong with being a pervert and/or slut. We're very special people. The best. Take pride in it. -- Hank B. (but I wish I had said it first)