*BSD News Article 11384


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA1721 ; Tue, 23 Feb 93 14:55:09 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!spool.mu.edu!nigel.msen.com!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!news.Hamburg.Germany.EU.net!abqhh!encap.hanse.de!encap.hanse.de!not-for-mail
From: maverick@encap.hanse.de (Jan-Oliver Neumann)
Newsgroups: comp.os.386bsd.bugs,comp.unix.bsd
Subject: Official UCB-fix for dump.
Date: 19 Feb 1993 16:39:55 +0100
Organization: Hanse Networking e.V., Hamburg, Germany
Lines: 95
Message-ID: <1m2v0b$3fb@encap.hanse.de>
NNTP-Posting-Host: encap.hanse.de

I browsed through my news-archive today an found this posting by Keith Bostic
in comp.bugs.4bsd.ucb-fixes:
----------------------------------snip-----------------------------------------
From: bostic@VANGOGH.CS.BERKELEY.EDU (Keith Bostic)
Newsgroups: comp.bugs.4bsd.ucb-fixes
Subject: V1.100 (Bug in NET2 dump and newly released dump)
Message-ID: <199301260206.AA13088@vangogh.CS.Berkeley.EDU>
Date: 26 Jan 93 02:06:25 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: world
Organization: University of California at Berkeley
Lines: 74
Approved: ucb-fixes@okeeffe.berkeley.edu

~Subject: Bug in NET2 dump and newly released dump.
Index: sbin/{dump,restore} 4.4BSD-alpha

Description:

	dumptraverse.c:mapfiles() contains a loop that begins with:

		for (ino = 0; ino < maxino; ino++) {
			dp = getino(ino);

	This contrasts with the loop in main() containing:

		for (map = dumpdirmap, ino = 0; ino < maxino; ) {
			dirty = GETDIRTY(ino)	/* Shortened for brevity. */
			ino++;
			if ((dirty & 1) == 0)
				continue;
			dp = getino(ino);	/* Work with dp. */		
		}

	and the subsequent loop using dumpinomap.

	While the loops in main() appear to be correct, the loop in
	mapfiles() can never invoke:

		SETINO(maxino, usedinomap)
	or 
		SETINO(maxino, dumpinomap);

	Changing the < to <= in mapfiles() (BUT NOT IN MAIN!!) fixes it.

Fix:
	Copies of the new dump/restore package are available by anonymous
	ftp from ftp.cs.berkeley.edu:ucb/4bsd/dump.restore.tar.Z.

	The following patch also fixes the problem.
[patch follows...]
------------------------------------snip------------------------------------
The version number of the patch doesn't match the one in the dump sources of
386BSD. I think Keith Bostic made it for 4.4BSD-alpha dump not for the Net-2
dump. So I remade the patch for 386BSD and left the version number untouched.

Best regards, Jan-Oliver

------------------------------------snip------------------------------------ 
*** /usr/src/sbin/dump/dumptraverse.c~	Fri Feb 19 16:04:26 1993
--- /usr/src/sbin/dump/dumptraverse.c	Fri Feb 19 16:09:33 1993
***************
*** 32,35 ****
--- 32,44 ----
   */
  
+ /* 
+   Jan-Oliver Neumann <maverick@encap.hanse.de>: Included the official UCB-
+       fix in mapfiles() for 4.4BSD-alpha and Net-2 posted by Keith Bostic
+       to comp.bugs.4bsd.ucb-fixes.
+       The message was posted on 26 Jan 93 02:06:25 GMT with messaged-id
+       <199301260206.AA13088@vangogh.CS.Berkeley.EDU>
+  
+ */
+ 
  #ifndef lint
  static char sccsid[] = "@(#)dumptraverse.c	5.11 (Berkeley) 3/7/91";
***************
*** 107,111 ****
  	int anydirskipped = 0;
  
! 	for (ino = 0; ino < maxino; ino++) {
  		dp = getino(ino);
  		if ((mode = (dp->di_mode & IFMT)) == 0)
--- 116,120 ----
  	int anydirskipped = 0;
  
! 	for (ino = 0; ino <= maxino; ino++) {             /* XXX */
  		dp = getino(ino);
  		if ((mode = (dp->di_mode & IFMT)) == 0)
---------------------------------snip--------------------------------------
-- 
Jan-Oliver Neumann                                     <maverick@encap.hanse.de>
Gegen Rassismus und Extremismus ------------------- Against racism and extremism
XXXXXXXXXXXXXXXXXXXXX Kopiere mich in deine Signature XXXXXXXXXXXXXXXXXXXXXXXXX