Skip to content
Snippets Groups Projects
Commit 1d5fc72b authored by Brian Carrier's avatar Brian Carrier
Browse files

auto_db processes file with no attributes

parent 3f6a2df0
Branches
No related tags found
No related merge requests found
......@@ -163,11 +163,11 @@ main(int argc, char **argv1)
if (autoDb->startAddImage(argc - OPTIND, &argv[OPTIND], imgtype, ssize)) {
tsk_error_print(stderr);
// reverts automatically on error
autoDb->revertAddImage();
exit(1);
}
if (autoDb->commitAddImage()) {
if (autoDb->commitAddImage() == -1) {
tsk_error_print(stderr);
exit(1);
}
......
......@@ -480,8 +480,14 @@ TskAutoDb::processFile(TSK_FS_FILE * fs_file, const char *path)
return TSK_ERR;
}
// process the attributes
TSK_RETVAL_ENUM retval = processAttributes(fs_file, path);
/* process the attributes. The case of having 0 attributes can occur
* with virtual / sparse files. At some point, this can probably be cleaned
* up if TSK is more consistent about if there should always be an attribute or not */
TSK_RETVAL_ENUM retval;
if (tsk_fs_file_attr_getsize(fs_file) == 0)
retval = insertFileData(fs_file, NULL, path, NULL, TSK_AUTO_CASE_FILE_KNOWN_UNKNOWN);
else
retval = processAttributes(fs_file, path);
if (m_db->releaseSavepoint("PROCESSFILE")) {
return TSK_ERR;
......
......@@ -244,8 +244,12 @@ tsk_fs_file_attr_check(TSK_FS_FILE * a_fs_file, char *a_func)
int
tsk_fs_file_attr_getsize(TSK_FS_FILE * a_fs_file)
{
if (tsk_fs_file_attr_check(a_fs_file, "tsk_fs_file_attr_getsize"))
if (tsk_fs_file_attr_check(a_fs_file, "tsk_fs_file_attr_getsize")) {
// @@@ Not sure if we should be ignoring this error or not...
// Just added the reset because we were returning 0 with error codes set
tsk_error_reset();
return 0;
}
return tsk_fs_attrlist_get_len(a_fs_file->meta->attr);
}
......
......@@ -156,6 +156,8 @@
02F9DE660D9BFCF2009C3F0E /* mmcat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mmcat.cpp; sourceTree = "<group>"; };
02F9DE670D9BFCF2009C3F0E /* mmls.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mmls.cpp; sourceTree = "<group>"; };
02F9DE680D9BFCF2009C3F0E /* mmstat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mmstat.cpp; sourceTree = "<group>"; };
D70295221469E7DD0087E028 /* case_db.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = case_db.cpp; sourceTree = "<group>"; };
D70295231469E7E40087E028 /* db_sqlite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = db_sqlite.cpp; sourceTree = "<group>"; };
D721CF8A126B5A3500AA2B16 /* tsk_gettimes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tsk_gettimes.cpp; sourceTree = "<group>"; };
D7774DF413E30DD100742A51 /* mult_files.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mult_files.c; sourceTree = "<group>"; };
D7864D7A134E2EFC00036A41 /* tsk_lock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsk_lock.c; sourceTree = "<group>"; };
......@@ -225,6 +227,8 @@
024D5A781166D46E00299079 /* auto */ = {
isa = PBXGroup;
children = (
D70295231469E7E40087E028 /* db_sqlite.cpp */,
D70295221469E7DD0087E028 /* case_db.cpp */,
D79CAB5F1215B2A4004F70CE /* tsk_auto_i.h */,
02DE5E43117A8A4500D94722 /* auto_db.cpp */,
024D5A7D11677D4D00299079 /* tsk_auto.h */,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment