From 79fc2a99ace9e7a9cdce7227320165f7fb57c591 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 26 Jan 2005 11:37:46 -0500 Subject: [PATCH] e2image.c (scramble_dir_block): Make sure the unused space in the '.' and '..' directory entries are cleared when e2image -rs is specified. --- misc/ChangeLog | 6 ++++++ misc/e2image.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 573b7fe..ba99457 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-26 Theodore Ts'o + + * e2image.c (scramble_dir_block): Make sure the unused space + in the '.' and '..' directory entries are cleared when + e2image -rs is specified. + 2005-01-24 Theodore Ts'o * tune2fs.8.in: Clarified man page about the -c option. diff --git a/misc/e2image.c b/misc/e2image.c index 5bca6b5..a7fc9b5 100644 --- a/misc/e2image.c +++ b/misc/e2image.c @@ -371,16 +371,16 @@ static void scramble_dir_block(ext2_filsys fs, blk_t blk, char *buf) dirent->name_len = rec_len - 8; continue; } - if (dirent->name_len==1 && p[8] == '.') - continue; - if (dirent->name_len==2 && p[8] == '.' && p[9] == '.') - continue; - cp = p+8; - memset(cp, 'A', dirent->name_len); len = rec_len - dirent->name_len - 8; if (len > 0) memset(cp+dirent->name_len, 0, len); + if (dirent->name_len==1 && cp[0] == '.') + continue; + if (dirent->name_len==2 && cp[0] == '.' && cp[1] == '.') + continue; + + memset(cp, 'A', dirent->name_len); len = dirent->name_len; id = name_id[len]++; while ((len > 0) && (id > 0)) { -- 1.8.3.1