Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File and directory collision bug #17

Open
shidel opened this issue Jul 23, 2022 · 3 comments
Open

File and directory collision bug #17

shidel opened this issue Jul 23, 2022 · 3 comments

Comments

@shidel
Copy link

shidel commented Jul 23, 2022

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.

@andrewbird
Copy link
Contributor

andrewbird commented Aug 14, 2022

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
Copy link

bttrx commented Aug 19, 2022

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

@andrewbird
Copy link
Contributor

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.

andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 1, 2022
andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 1, 2022
andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 1, 2022
If the BPB is either v4.1 or v7 long, then its volume label field
should be written.

Note:
  This site https://jdebp.uk/FGA/bios-parameter-block.html suggests that
it is perfectly valid to have a v7 long BPB with a FAT12 or FAT16
filesystem, although more usually it's used for FAT32. However I can't
see any confirmation of this elsewhere, haven't seen an example of this
in the wild, and have no means of generating a test article. More
importantly since we are writing to the filesystem, it's important to
not have any false positives or we could cause corruption. So for now
this combination, should it exist, will not be updated. See the
discussion here dosemu2/fdpp#202.

Part of a fix for [FDOS/label#17]
andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 5, 2022
andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 5, 2022
If the BPB is either v4.1 or v7 long, then its volume label field
should be written.

Note:
  This site https://jdebp.uk/FGA/bios-parameter-block.html suggests that
it is perfectly valid to have a v7 long BPB with a FAT12 or FAT16
filesystem, although more usually it's used for FAT32. However I can't
see any confirmation of this elsewhere, haven't seen an example of this
in the wild, and have no means of generating a test article. More
importantly since we are writing to the filesystem, it's important to
not have any false positives or we could cause corruption. So for now
this combination, should it exist, will not be updated. See the
discussion here dosemu2/fdpp#202.

Part of a fix for [FDOS/label#17]
andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 10, 2022
andrewbird added a commit to andrewbird/kernel that referenced this issue Nov 10, 2022
If the BPB is either v4.1 or v7 long, then its volume label field
should be written.

Note:
  This site https://jdebp.uk/FGA/bios-parameter-block.html suggests that
it is perfectly valid to have a v7 long BPB with a FAT12 or FAT16
filesystem, although more usually it's used for FAT32. However I can't
see any confirmation of this elsewhere, haven't seen an example of this
in the wild, and have no means of generating a test article. More
importantly since we are writing to the filesystem, it's important to
not have any false positives or we could cause corruption. So for now
this combination, should it exist, will not be updated. See the
discussion here dosemu2/fdpp#202.

Part of a fix for [FDOS/label#17]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants