Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107951944
D32699.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
860 B
Referenced Files
None
Subscribers
None
D32699.diff
View Options
diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c
--- a/sbin/fsck_msdosfs/dir.c
+++ b/sbin/fsck_msdosfs/dir.c
@@ -400,8 +400,21 @@
if (dir->head == CLUST_FREE) {
physicalSize = 0;
} else {
- if (!fat_is_valid_cl(fat, dir->head))
- return FSERROR;
+ if (!fat_is_valid_cl(fat, dir->head) || !fat_is_cl_head(fat, dir->head)) {
+ pwarn("Directory entry %s of size %u referencing invalid cluster %u\n",
+ fullpath(dir), dir->size, dir->head);
+ if (ask(1, "Truncate")) {
+ p[28] = p[29] = p[30] = p[31] = 0;
+ p[26] = p[27] = 0;
+ if (boot->ClustMask == CLUST32_MASK)
+ p[20] = p[21] = 0;
+ dir->size = 0;
+ dir->head = CLUST_FREE;
+ return FSDIRMOD;
+ } else {
+ return FSERROR;
+ }
+ }
ret = checkchain(fat, dir->head, &chainsize);
/*
* Upon return, chainsize would hold the chain length
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 20, 9:30 PM (12 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15985437
Default Alt Text
D32699.diff (860 B)
Attached To
Mode
D32699: fsck_msdosfs: truncate directory entry when the head pointer is invalid.
Attached
Detach File
Event Timeline
Log In to Comment