rfc: [patch 1/6] more e2fsprogs fixes

Alexandre Ratchov <[email protected]> Fri, 25 Aug 2006 15:16:12 +0200
Newsgroups gmane.comp.file-systems.ext2.devel
Message-ID <[email protected]>
don't use of uninitialized variables in fsck, (bug
intruduced by the "pblk" patch). This patch have to be
applied on top of the "pblk" patch.

Index: e2fsprogs-1.39/e2fsck/pass1.c
===================================================================
--- e2fsprogs-1.39.orig/e2fsck/pass1.c	2006-08-21 19:01:03.000000000 +0200
+++ e2fsprogs-1.39/e2fsck/pass1.c	2006-08-21 19:07:43.000000000 +0200
@@ -2226,19 +2226,19 @@ static void handle_fs_bad_blocks(e2fsck_
 
 	for (i = 0; i < fs->group_desc_count; i++) {
 		if (ctx->invalid_block_bitmap_flag[i]) {
-			blk_t blk;
+			blk_t blk = fs->group_desc[i].bg_block_bitmap;
 			new_table_block(ctx, first_block, i, _("block bitmap"),
 					1, &blk);
 			fs->group_desc[i].bg_block_bitmap = blk;
 		}
 		if (ctx->invalid_inode_bitmap_flag[i]) {
-			blk_t blk;
+			blk_t blk = fs->group_desc[i].bg_inode_bitmap;
 			new_table_block(ctx, first_block, i, _("inode bitmap"),
 					1, &blk);
 			fs->group_desc[i].bg_inode_bitmap = blk;
 		}
 		if (ctx->invalid_inode_table_flag[i]) {
-			blk_t blk;
+			blk_t blk = fs->group_desc[i].bg_inode_table;
 			new_table_block(ctx, first_block, i, _("inode table"),
 					fs->inode_blocks_per_group, 
 					&blk);
Index: e2fsprogs-1.39/debugfs/icheck.c
===================================================================
--- e2fsprogs-1.39.orig/debugfs/icheck.c	2006-08-21 19:01:03.000000000 +0200
+++ e2fsprogs-1.39/debugfs/icheck.c	2006-08-21 19:02:05.000000000 +0200
@@ -112,7 +112,7 @@ void do_icheck(int argc, char **argv)
 		bw.inode = ino;
 
 		if (inode.i_file_acl) {
-			blk_t i_file_acl;
+			blk_t i_file_acl = inode.i_file_acl;
 			icheck_proc(current_fs, &i_file_acl, 0,
 				    0, 0, &bw);
 			inode.i_file_acl = i_file_acl;
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642