Re: Bug in ext2fs or e2fsck 1.02?

Greg Alexander (galexand@sietch.bloomington.in.us)
Sun, 19 Jan 1997 12:51:39 -0500 (EST)


On Sun, 19 Jan 1997, Colin Plumb wrote:

> While dealing with some disk corruption, I managed to create some
> directories which appeared, to ls, to be fine, but would fail
> the empty_dir test in fs/ext2/namei.c:553. To be precise, line 572,
> where it does "strcmp(".", de->name). It seems that de->name[1] was
> not '\0'. Of course, de->name_len was 1, so ls produced fine
> results, but the test failed.
>
> e2fsck 1.02 (I know, I know) does not detect or correct this problem,
> but ext2fs doesn't like it. I don't know which of the two is considered
> to have the bug, but one of them does.

In this case, that strcmp should become strncmp(".",de->name,de->name_len);
But e2fsck prolly oughta check anyways.

Greg Alexander
http://www.cia-g.com/~sietch/