diff options
author | Stef Walter <stef@thewalter.net> | 2004-08-16 16:46:29 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2004-08-16 16:46:29 +0000 |
commit | 880e7364a7b9e73ab2193e02ffa92af5b8647083 (patch) | |
tree | d931a800d4769fc1252149afebe47fc5e2d73008 /src/ntfsx.c | |
parent | 79896ee5a3fea2c3c32ffff0bcc6f0e17c424516 (diff) |
- Don't exit on error reading source disk
- Don't try to map sectors when no MFT loaded
Diffstat (limited to 'src/ntfsx.c')
-rw-r--r-- | src/ntfsx.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ntfsx.c b/src/ntfsx.c index 60ddb66..6008e1a 100644 --- a/src/ntfsx.c +++ b/src/ntfsx.c @@ -299,7 +299,7 @@ ntfsx_attribute* ntfsx_attrib_enum_list(ntfsx_attrib_enum* attrenum, ntfsx_recor /* If we're done */ if(attrenum->_flags & ATTR_ENUM_DONELIST) return NULL; - + cluster = ntfsx_record_cluster(record); rechead = ntfsx_record_header(record); @@ -323,10 +323,17 @@ ntfsx_attribute* ntfsx_attrib_enum_list(ntfsx_attrib_enum* attrenum, ntfsx_recor attrenum->_flags |= ATTR_ENUM_DONELIST; return NULL; } + + /* We don't do attribute lists when no MFT loaded */ + if(!record->info->mftmap) + { + warnx("extended file attributes, but no MFT loaded. skipping"); + attrenum->_flags |= ATTR_ENUM_DONELIST; + return NULL; + } } /* This has to be set by now */ - ASSERT(record->info->mftmap); ASSERT(attrenum->_attrhead); ASSERT(attrenum->_attrhead->type == kNTFS_ATTRIBUTE_LIST); @@ -454,7 +461,10 @@ bool ntfsx_record_read(ntfsx_record* record, uint64 begSector, int dd) ntfs_recordheader* rechead; if(!ntfsx_cluster_read(&(record->_clus), record->info, begSector, dd)) - err(1, "couldn't read mft record from drive"); + { + warn("couldn't read mft record from drive"); + return false; + } /* Check and validate this record */ rechead = ntfsx_record_header(record); |