e2fsprogs/e2fsprogs-1.40-be_swap_fix.patch

33 lines
1.3 KiB
Diff

commit db9097caca17401313c0dc840b4ae683e5b5c1df
Author: Eric Sandeen <sandeen@redhat.com>
Date: Tue Jul 17 20:40:25 2007 -0500
Fix big-endian byte-swapping bug in ext2fs_swap_inode_full()
We need to set t->i_file_acl before we test it in
ext2fs_inode_data_blocks()
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
index a40caa9..6576c59 100644
--- a/lib/ext2fs/swapfs.c
+++ b/lib/ext2fs/swapfs.c
@@ -150,6 +150,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
t->i_dtime = ext2fs_swab32(f->i_dtime);
t->i_gid = ext2fs_swab16(f->i_gid);
t->i_links_count = ext2fs_swab16(f->i_links_count);
+ t->i_file_acl = ext2fs_swab32(f->i_file_acl);
if (hostorder)
has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) f);
@@ -158,7 +159,6 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) t);
t->i_flags = ext2fs_swab32(f->i_flags);
- t->i_file_acl = ext2fs_swab32(f->i_file_acl);
t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
if (!islnk || has_data_blocks ) {
for (i = 0; i < EXT2_N_BLOCKS; i++)