Skip to content

Commit

Permalink
'#1782: Use sleuth.db location from the case.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Jul 28, 2023
1 parent ffbcac0 commit 6caf5e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion iped-engine/src/main/java/iped/engine/task/index/IndexItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@
import org.apache.tika.metadata.TikaCoreProperties;
import org.apache.tika.mime.MediaType;
import org.apache.tika.utils.DateUtils;
import org.sleuthkit.datamodel.SleuthkitCase;

import iped.data.IItem;
import iped.datasource.IDataSource;
import iped.engine.data.DataSource;
import iped.engine.data.IPEDSource;
import iped.engine.data.Item;
import iped.engine.lucene.analysis.FastASCIIFoldingFilter;
import iped.engine.sleuthkit.SleuthkitInputStreamFactory;
import iped.engine.task.ImageThumbTask;
import iped.engine.task.MinIOTask.MinIOInputInputStreamFactory;
import iped.engine.task.similarity.ImageSimilarityTask;
Expand Down Expand Up @@ -810,7 +812,14 @@ public static IItem getItem(Document doc, IPEDSource iCase, boolean viewItem) {
if (doc.get(IndexItem.SOURCE_PATH) != null && doc.get(IndexItem.SOURCE_DECODER) != null) {
String sourcePath = doc.get(IndexItem.SOURCE_PATH);
String className = doc.get(IndexItem.SOURCE_DECODER);
if (!MinIOInputInputStreamFactory.class.getName().equals(className)) {
if (SleuthkitInputStreamFactory.class.getName().equals(className)) {
// Use the correct TSK database (sleuth.db location and name may change in some
// situations), to avoid issue #1782.
SleuthkitCase sleuthCase = iCase.getSleuthCase();
if (sleuthCase != null) {
sourcePath = sleuthCase.getDbDirPath() + File.separatorChar + sleuthCase.getDatabaseName();
}
} else if (!MinIOInputInputStreamFactory.class.getName().equals(className)) {
sourcePath = Util.getResolvedFile(outputBase.getParent(), sourcePath).toString();
}
synchronized (inputStreamFactories) {
Expand Down

0 comments on commit 6caf5e5

Please sign in to comment.