FDOS/label

File and directory collision bug

shidel opened this issue · 3 comments

Reported on SourceForge as Issue 365

According to the bug report... Basically, LABEL is overwriting root directory entries for files and directories without checking for conflicts. Without testing myself, I would assume it is probably also corrupting the filesystem when it overwrites an entry.

I've written some tests (calls the int21/16 function directly) for Dosemu2's test suite that show that at least some part of the problem is in the kernel.

FreeDOS (git and 1.2) kernel on FAT does:
a) With existing file, volume is set but the existing file is deleted
b) With existing directory, the function returns failure.

With MS-DOS 6.22 and DR-DOS 7.01 the existing file or directory is left intact and the volume label is set in a duplicate file, but with the VOL attr set(effectively hidden). These DOSs also set the volume name in the BPB.

Edit: updated some incorrect statements.

bttrx commented

Probably connected or the same issue: https://gitlab.com/FreeDOS/issue-reporting/-/issues/31

Thanks Robert, I have seen this already and I do agree that it's probably connected. Once I figure out what exactly is required in both Label and Kernel I'll try to submit patches.
Thanks again for the heads-up.