From owner-freebsd-bugs Fri Feb 28 11:20:06 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA12846 for bugs-outgoing; Fri, 28 Feb 1997 11:20:06 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA12839; Fri, 28 Feb 1997 11:20:03 -0800 (PST) Resent-Date: Fri, 28 Feb 1997 11:20:03 -0800 (PST) Resent-Message-Id: <199702281920.LAA12839@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, fenner@parc.xerox.com Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id LAA12385 for ; Fri, 28 Feb 1997 11:15:13 -0800 (PST) Received: from fenestro.parc.xerox.com ([13.0.208.199]) by alpha.xerox.com with SMTP id <16973(4)>; Fri, 28 Feb 1997 11:14:38 PST Received: (from fenner@localhost) by fenestro.parc.xerox.com (8.8.4/8.8.4) id LAA10869; Fri, 28 Feb 1997 11:14:52 -0800 (PST) Message-Id: <199702281914.LAA10869@fenestro.parc.xerox.com> Date: Fri, 28 Feb 1997 11:14:52 PST From: Bill Fenner Reply-To: fenner@parc.xerox.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/2832: w treats corrupted utmp as fatal error Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 2832 >Category: bin >Synopsis: w treats corrupted utmp as fatal error >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 28 11:20:01 PST 1997 >Last-Modified: >Originator: Bill Fenner >Organization: Xerox >Release: FreeBSD 2.2-BETA_A i386 >Environment: FreeBSD fenestro.parc.xerox.com 2.2-BETA_A FreeBSD 2.2-BETA_A #1: Sat Jan 18 18:30:51 PST 1997 fenner@fenestro.parc.xerox.com:/usr/src/sys/compile/FENESTRO i386 2.2-BETA installed via ftp from ftp.freebsd.org in mid-January. X11R6 installed in that installation. >Description: My utmp file got corrupted (I don't know how). % who | cat -v root ttyv0 Feb 22 20:08 fenner ttyv1 Feb 22 21:30 fenner ttyp5 Feb 27 17:26 (crevenia) 4 {q^P3ttypDec 31 16:00 (er) w fails to run: % w w: /dev//{q^P3ttyp4: No such file or directory while it could at least manage to print out as much as who does. >How-To-Repeat: Corrupt your utmp file so that a tty field references a nonexistent device, and then run "w". >Fix: --- w.c.orig Fri Feb 28 11:10:06 1997 +++ w.c Fri Feb 28 11:11:28 1997 @@ -438,7 +438,7 @@ (void)snprintf(ttybuf, sizeof(ttybuf), "%s/%s", _PATH_DEV, line); if (stat(ttybuf, &sb)) - err(1, "%s", ttybuf); + warn("%s", ttybuf); return (&sb); } % ./w |& cat -v w: /dev//{q^P3ttyp4: No such file or directory 11:12AM up 5 days, 15:06, 5 users, load averages: 0.04, 0.03, 0.00 USER TTY FROM LOGIN@ IDLE WHAT root v0 - Sat08PM 13:54 -csh (csh) fenner v1 - Sat09PM 5days xinit ttyp0 fenner 13Aug95 9:12 - fenner p5 crevenia 5:26PM - ./w 4 {q^P er 31Dec69 - - >Audit-Trail: >Unformatted: