[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

One more patch for MinixFs PL10



After exchanging email with Daniel Eriksson, and having checked the
diffs recently posted by Michael Hohmuth, I decided to post the
following patch for MinixFs PL10.

Stephen Henson has been informed of this bug, and I was content to
wait until he had PL11 ready. However, since the recent diffs
posted by Michael have set a precedent...

This bug affects filesystems partitioned to accept filenames longer
than 14 characters. It basically allows the parent directory to be
deleted from within a subdirectory, possibly (Read: definately!)
resulting in the total loss of a large part of the directory heirarchy.
Since I don't have a virgin PL10 to diff against, I'm posting the one
line change needed to 'dir.c'. Hopefully someone (Michael?) will then
incorporate this into the main diffs. (You *won't* need to re-minit
existing filesystems for this fix to take effect.)

File: dir.c , At or near line 57:

			/* Never ever allow unlinking of '.' or '..' */
			if(zone==0 && entry<(2 * incr))return EACCDN;
				try->d_inum=0;


The key change is "(2 * incr)", which was previously just "2", if
my memory serves. I leave it to the programmers out there to figure
the consequences to their filesystem if this bug occurs. B-)

Cheers, Steve