Subject: bin/223: another off_t victim (tunefs)
To: None <gnats-admin>
From: None <thomas@mathematik.uni-Bremen.de>
List: netbsd-bugs
Date: 04/10/1994 13:35:02
>Number:         223
>Category:       bin
>Synopsis:       another off_t victim (tunefs)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 10 13:35:01 1994
>Originator:     Thomas Eberhardt
>Organization:
CeVis, University of Bremen, Germany
>Release:        
>Environment:
	
System: NetBSD ed209 0.9a ED209#0 i386

Machine: i386
>Description:
	tunefs is currently broken since it passes a off_t to a function
	that expects a daddr_t.
>How-To-Repeat:
	tunefs -m 0 <any-fs>
>Fix:
*** tunefs/tunefs.c-	Fri Dec 17 07:37:12 1993
--- tunefs/tunefs.c	Sun Apr 10 13:46:19 1994
***************
*** 203,209 ****
  	}
  	if (argc != 1)
  		goto usage;
! 	bwrite(SBOFF / dev_bsize, (char *)&sblock, SBSIZE);
  	if (Aflag)
  		for (i = 0; i < sblock.fs_ncg; i++)
  			bwrite(fsbtodb(&sblock, cgsblock(&sblock, i)),
--- 203,209 ----
  	}
  	if (argc != 1)
  		goto usage;
! 	bwrite((daddr_t)(SBOFF / dev_bsize), (char *)&sblock, SBSIZE);
  	if (Aflag)
  		for (i = 0; i < sblock.fs_ncg; i++)
  			bwrite(fsbtodb(&sblock, cgsblock(&sblock, i)),
***************
*** 232,238 ****
  		perror(file);
  		exit(3);
  	}
! 	if (bread(SBOFF, (char *)fs, SBSIZE)) {
  		fprintf(stderr, "bad super block");
  		perror(file);
  		exit(4);
--- 232,238 ----
  		perror(file);
  		exit(3);
  	}
! 	if (bread((daddr_t)SBOFF, (char *)fs, SBSIZE)) {
  		fprintf(stderr, "bad super block");
  		perror(file);
  		exit(4);
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------