From owner-freebsd-bugs Sun Sep 8 17:40:07 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA08180 for bugs-outgoing; Sun, 8 Sep 1996 17:40:07 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA08143; Sun, 8 Sep 1996 17:40:03 -0700 (PDT) Resent-Date: Sun, 8 Sep 1996 17:40:03 -0700 (PDT) Date: Sun, 8 Sep 1996 17:40:03 -0700 (PDT) From: GNU GNATS Resent-Message-Id: <199609090040.RAA08143@freefall.freebsd.org> Message-Id: <199609090040.RAA08143@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, Received:"from perki0.connect.com.au (perki0.connect.com.au [192.189.54.85]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA07968 for" ; Sun, 8 Sep 1996 17:39:27.-0700 (PDT) Received: (from Unemeton@localhost) by perki0.connect.com.au id KAA06737 (8.7.5/IDA-1.6 for FreeBSD-gnats-submit@freebsd.org); Mon, 9 Sep 1996 10:39:15 +1000 (EST) Subject: bin/1585: dumpfs can dump core To: undisclosed-recipients:; Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1585 >Category: bin >Synopsis: dumpfs can dump core >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 8 17:40:01 PDT 1996 >Last-Modified: >Originator: Giles Lean >Organization: >Release: FreeBSD 2.2-CURRENT i386 >Environment: 2.2-current >Description: dumpfs blindly trusts that it is working on a filesystem. >How-To-Repeat: (No filesystem creaed on /dev/rsd1e) # dumpfs /dev/rsd1e magic 0 time Thu Jan 1 10:00:00 1970 cylgrp dynamic inodes 4.2/4.3BSD nbfree 0 ndir 0 nifree 0 nffree 0 ncg 0 ncyl 0 size 0 blocks 0 bsize 0 shift 0 mask 0x00000000 fsize 0 shift 0 mask 0x00000000 frag 0 shift 0 fsbtodb 0 Floating point exception (core dumped) # >Fix: Test for FS_MAGIC. This fix is taken from NetBSD PR bin/249, closed in December 1994. (Am I the only person in the world who uses dumpfs on the wrong partition? :) --- dumpfs.c-old Mon Sep 9 10:26:30 1996 +++ dumpfs.c Mon Sep 9 10:30:22 1996 @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -114,6 +115,13 @@ goto err; if (read(fd, &afs, SBSIZE) != SBSIZE) goto err; + + if (afs.fs_magic != FS_MAGIC) { + warnx("%s: superblock has bad magic number, skipping.", + name); + (void) close(fd); + return (1); + } if (afs.fs_postblformat == FS_42POSTBLFMT) afs.fs_nrpos = 8; >Audit-Trail: >Unformatted: >Received: from topaz.nemeton.com.au (topaz.nemeton.com.au [203.8.3.18]) by nemeton.com.au (8.7.5/8.7.3) with ESMTP id KAA18337 for ; Mon, 9 Sep 1996 10:40:40 +1000 (EST) Received: from topaz.nemeton.com.au (topaz.nemeton.com.au [203.8.3.18]) by nemeton.com.au (8.7.5/8.7.3) with ESMTP id KAA18337 for ; Mon, 9 Sep 1996 10:40:40 +1000 (EST) Received: (from giles@localhost) by topaz.nemeton.com.au (8.7.5/8.7.3) id KAA00376; Mon, 9 Sep 1996 10:40:25 +1000 (EST) Date: Mon, 9 Sep 1996 10:40:25 +1000 (EST) From: Giles Lean Message-Id: <199609090040.KAA00376@topaz.nemeton.com.au> To: FreeBSD-gnats-submit@freebsd.org Subject: dumpfs can dump core Reply-To: giles@nemeton.com.au X-send-pr-version: 3.2 Content-Type: text