mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Merge remote-tracking branch 'upstream/release-4.11.0' into develop
This commit is contained in:
commit
aaf5d4dc75
@ -43,6 +43,8 @@ import org.sleuthkit.autopsy.casemodule.multiusercasesbrowser.MultiUserCaseBrows
|
||||
public final class MultiUserCasesBrowserPanel extends javax.swing.JPanel implements ExplorerManager.Provider {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final int NAME_COLUMN_INDEX = 0;
|
||||
private static final int NAME_COLUMN_WIDTH = 150;
|
||||
private final ExplorerManager explorerManager;
|
||||
private final MultiUserCaseBrowserCustomizer customizer;
|
||||
private final OutlineView outlineView;
|
||||
@ -103,6 +105,11 @@ public final class MultiUserCasesBrowserPanel extends javax.swing.JPanel impleme
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Give the case name column a greater width.
|
||||
*/
|
||||
outline.getColumnModel().getColumn(NAME_COLUMN_INDEX).setPreferredWidth(NAME_COLUMN_WIDTH);
|
||||
|
||||
/*
|
||||
* Hide the root node and configure the node selection mode.
|
||||
*/
|
||||
|
@ -53,6 +53,8 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
|
||||
private final static String ADMIN_ACCESS_FILE_NAME = "admin"; // NON-NLS
|
||||
private final static String ADMIN_ACCESS_FILE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), ADMIN_ACCESS_FILE_NAME).toString();
|
||||
private final static String ADMIN_EXT_ACCESS_FILE_NAME = "adminext"; // NON-NLS
|
||||
private final static String ADMIN_EXT_ACCESS_FILE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), ADMIN_EXT_ACCESS_FILE_NAME).toString();
|
||||
private final static String AID_REFRESH_THREAD_NAME = "AID-refresh-jobs-%d";
|
||||
private final static int AID_REFRESH_INTERVAL_SECS = 30;
|
||||
private final static int AID_DELAY_BEFORE_FIRST_REFRESH = 0;
|
||||
@ -277,8 +279,8 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the table models using a RefreshChildrenEvent and refreshes the JTables
|
||||
* that use the models.
|
||||
* Reloads the table models using a RefreshChildrenEvent and refreshes the
|
||||
* JTables that use the models.
|
||||
*
|
||||
*/
|
||||
void refreshTables() {
|
||||
@ -318,9 +320,24 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not system adminstrator features of the dashboard
|
||||
* are enabled.
|
||||
*
|
||||
* @return True or false.
|
||||
*/
|
||||
static boolean isAdminAutoIngestDashboard() {
|
||||
File f = new File(ADMIN_ACCESS_FILE_PATH);
|
||||
return f.exists();
|
||||
return new File(ADMIN_ACCESS_FILE_PATH).exists() || new File(ADMIN_EXT_ACCESS_FILE_PATH).exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the extended system administrator features of the
|
||||
* cases dashboard are enabled.
|
||||
*
|
||||
* @return True or false.
|
||||
*/
|
||||
static boolean extendedFeaturesAreEnabled() {
|
||||
return new File(ADMIN_EXT_ACCESS_FILE_PATH).exists();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1271,12 +1271,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
* @param nodeData The data stored in the manifest file coordination
|
||||
* service node for the job.
|
||||
*
|
||||
* @throws AutoIngestJobException If there was an error working
|
||||
* with the node data.
|
||||
* @throws InterruptedException If the thread running the input
|
||||
* directory scan task is
|
||||
* interrupted while blocked, i.e.,
|
||||
* if auto ingest is shutting down.
|
||||
* @throws AutoIngestJobException If there was an error working with the
|
||||
* node data.
|
||||
* @throws InterruptedException If the thread running the input
|
||||
* directory scan task is interrupted
|
||||
* while blocked, i.e., if auto ingest is
|
||||
* shutting down.
|
||||
*/
|
||||
private void addPendingJob(Manifest manifest, AutoIngestJobNodeData nodeData) throws AutoIngestJobException, InterruptedException {
|
||||
AutoIngestJob job;
|
||||
@ -1415,6 +1415,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
sysLogger.log(Level.SEVERE, String.format("Error writing case auto ingest log entry for crashed job for %s", manifestPath), ex);
|
||||
}
|
||||
}
|
||||
updateAutoIngestJobData(job);
|
||||
newPendingJobsList.add(job);
|
||||
} else {
|
||||
job.setProcessingStatus(AutoIngestJob.ProcessingStatus.COMPLETED);
|
||||
job.setCompletedDate(Date.from(Instant.now()));
|
||||
@ -1425,9 +1427,9 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
sysLogger.log(Level.SEVERE, String.format("Error writing case auto ingest log entry for crashed job for %s", manifestPath), ex);
|
||||
}
|
||||
}
|
||||
updateAutoIngestJobData(job);
|
||||
newCompletedJobsList.add(job);
|
||||
}
|
||||
updateAutoIngestJobData(job);
|
||||
newPendingJobsList.add(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1440,12 +1442,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
* @param nodeData The data stored in the manifest file lock
|
||||
* coordination service node for the job.
|
||||
*
|
||||
* @throws AutoIngestJobException If there was an error working
|
||||
* with the node data.
|
||||
* @throws InterruptedException If the thread running the input
|
||||
* directory scan task is
|
||||
* interrupted while blocked, i.e.,
|
||||
* if auto ingest is shutting down.
|
||||
* @throws AutoIngestJobException If there was an error working with the
|
||||
* node data.
|
||||
* @throws InterruptedException If the thread running the input
|
||||
* directory scan task is interrupted
|
||||
* while blocked, i.e., if auto ingest is
|
||||
* shutting down.
|
||||
*/
|
||||
private void addCompletedJob(Manifest manifest, AutoIngestJobNodeData nodeData) throws AutoIngestJobException, InterruptedException {
|
||||
Path caseDirectoryPath = nodeData.getCaseDirectoryPath();
|
||||
@ -1995,15 +1997,26 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
AutoIngestJobNodeData nodeData = new AutoIngestJobNodeData(coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestPath.toString()));
|
||||
if (!nodeData.getProcessingStatus().equals(PENDING)) {
|
||||
iterator.remove();
|
||||
manifestLock.release();
|
||||
manifestLock = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ditto for the presence of the manifest file.
|
||||
*/
|
||||
File manifestFile = nodeData.getManifestFilePath().toFile();
|
||||
if (!manifestFile.exists()) {
|
||||
iterator.remove();
|
||||
manifestLock.release();
|
||||
manifestLock = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, check for devoting too many resources to a
|
||||
* single case, if the check is enabled.
|
||||
*/
|
||||
if (enforceMaxJobsPerCase) {
|
||||
int currentJobsForCase = 0;
|
||||
for (AutoIngestJob runningJob : hostNamesToRunningJobs.values()) {
|
||||
|
@ -18,14 +18,11 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.experimental.autoingest;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.Action;
|
||||
import org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData;
|
||||
import org.sleuthkit.autopsy.casemodule.multiusercasesbrowser.MultiUserCaseBrowserCustomizer;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
|
||||
/**
|
||||
* A customizer for the multi-user case browser panel used in the administrative
|
||||
@ -34,8 +31,6 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
*/
|
||||
final class CasesDashboardCustomizer implements MultiUserCaseBrowserCustomizer {
|
||||
|
||||
private final static String ADMIN_EXT_ACCESS_FILE_NAME = "adminext"; // NON-NLS
|
||||
private final static String ADMIN_EXT_ACCESS_FILE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), ADMIN_EXT_ACCESS_FILE_NAME).toString();
|
||||
private final DeleteCaseAction deleteCaseAction;
|
||||
private final DeleteCaseInputAction deleteCaseInputAction;
|
||||
private final DeleteCaseOutputAction deleteCaseOutputAction;
|
||||
@ -67,7 +62,7 @@ final class CasesDashboardCustomizer implements MultiUserCaseBrowserCustomizer {
|
||||
properties.add(Column.LAST_ACCESS_DATE);
|
||||
properties.add(Column.DIRECTORY);
|
||||
properties.add(Column.MANIFEST_FILE_ZNODES_DELETE_STATUS);
|
||||
if (CasesDashboardCustomizer.extendedFeaturesAreEnabled()) {
|
||||
if (AutoIngestDashboard.extendedFeaturesAreEnabled()) {
|
||||
properties.add(Column.DATA_SOURCES_DELETE_STATUS);
|
||||
}
|
||||
properties.add(Column.TEXT_INDEX_DELETE_STATUS);
|
||||
@ -93,7 +88,7 @@ final class CasesDashboardCustomizer implements MultiUserCaseBrowserCustomizer {
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new OpenCaseAction(nodeData));
|
||||
actions.add(new OpenAutoIngestLogAction(nodeData));
|
||||
if (CasesDashboardCustomizer.extendedFeaturesAreEnabled()) {
|
||||
if (AutoIngestDashboard.extendedFeaturesAreEnabled()) {
|
||||
actions.add(deleteCaseInputAction);
|
||||
actions.add(deleteCaseOutputAction);
|
||||
actions.add(deleteCaseInputAndOutputAction);
|
||||
@ -108,15 +103,4 @@ final class CasesDashboardCustomizer implements MultiUserCaseBrowserCustomizer {
|
||||
return new OpenCaseAction(nodeData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the extended system administrator features of the
|
||||
* cases dashboard are enabled.
|
||||
*
|
||||
* @return True or false.
|
||||
*/
|
||||
static boolean extendedFeaturesAreEnabled() {
|
||||
File f = new File(ADMIN_EXT_ACCESS_FILE_PATH);
|
||||
return f.exists();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -646,13 +646,22 @@ public class GroupManager {
|
||||
// reset the hash cache
|
||||
controller.getHashSetManager().invalidateHashSetsCacheForFile(fileId);
|
||||
|
||||
// first of all, update the current path group, regardless of what grouping is in view
|
||||
try {
|
||||
DrawableFile file = getDrawableDB().getFileFromID(fileId);
|
||||
String pathVal = file.getDrawablePath();
|
||||
GroupKey<?> pathGroupKey = new GroupKey<>(DrawableAttribute.PATH,pathVal, file.getDataSource());
|
||||
|
||||
updateCurrentPathGroup(pathGroupKey);
|
||||
} catch (TskCoreException | TskDataException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
}
|
||||
|
||||
// Update the current groups (if it is visible)
|
||||
Set<GroupKey<?>> groupsForFile = getGroupKeysForCurrentGroupBy(fileId);
|
||||
for (GroupKey<?> gk : groupsForFile) {
|
||||
// see if a group has been created yet for the key
|
||||
DrawableGroup g = getGroupForKey(gk);
|
||||
|
||||
updateCurrentPathGroup(gk);
|
||||
addFileToGroup(g, gk, fileId);
|
||||
}
|
||||
}
|
||||
@ -756,8 +765,10 @@ public class GroupManager {
|
||||
controller.getCategoryManager().registerListener(group);
|
||||
groupMap.put(groupKey, group);
|
||||
}
|
||||
|
||||
if (analyzedGroups.contains(group) == false) {
|
||||
|
||||
// Add to analyzedGroups only if it's the same group type as the one in view
|
||||
if ((analyzedGroups.contains(group) == false) &&
|
||||
(getGroupBy() == group.getGroupKey().getAttribute())) {
|
||||
analyzedGroups.add(group);
|
||||
sortAnalyzedGroups();
|
||||
}
|
||||
|
@ -170,16 +170,21 @@ abstract class Extract {
|
||||
ResultSet temprs;
|
||||
List<HashMap<String, Object>> list;
|
||||
String connectionString = "jdbc:sqlite:" + path; //NON-NLS
|
||||
SQLiteDBConnect tempdbconnect = null;
|
||||
try {
|
||||
SQLiteDBConnect tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", connectionString); //NON-NLS
|
||||
tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", connectionString); //NON-NLS
|
||||
temprs = tempdbconnect.executeQry(query);
|
||||
list = this.resultSetToArrayList(temprs);
|
||||
tempdbconnect.closeConnection();
|
||||
} catch (SQLException ex) {
|
||||
logger.log(Level.SEVERE, "Error while trying to read into a sqlite db." + connectionString, ex); //NON-NLS
|
||||
errorMessages.add(NbBundle.getMessage(this.getClass(), "Extract.dbConn.errMsg.failedToQueryDb", getName()));
|
||||
return Collections.<HashMap<String, Object>>emptyList();
|
||||
}
|
||||
finally {
|
||||
if (tempdbconnect != null) {
|
||||
tempdbconnect.closeConnection();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -253,6 +253,7 @@ class ExtractRegistry extends Extract {
|
||||
logger.log(Level.WARNING, "Keyword search service not found. Report will not be indexed");
|
||||
} else {
|
||||
searchService.index(report);
|
||||
report.close();
|
||||
}
|
||||
} catch (TskCoreException e) {
|
||||
this.addErrorMessage("Error adding regripper output as Autopsy report: " + e.getLocalizedMessage()); //NON-NLS
|
||||
|
@ -148,8 +148,9 @@ class Util {
|
||||
String query = "PRAGMA table_info(" + tablename + ")"; //NON-NLS
|
||||
boolean found = false;
|
||||
ResultSet temprs;
|
||||
SQLiteDBConnect tempdbconnect = null;
|
||||
try {
|
||||
SQLiteDBConnect tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", "jdbc:sqlite:" + connection); //NON-NLS
|
||||
tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", "jdbc:sqlite:" + connection); //NON-NLS
|
||||
temprs = tempdbconnect.executeQry(query);
|
||||
while (temprs.next()) {
|
||||
if (temprs.getString("name") == null ? column == null : temprs.getString("name").equals(column)) { //NON-NLS
|
||||
@ -159,6 +160,11 @@ class Util {
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.WARNING, "Error while trying to get columns from sqlite db." + connection, ex); //NON-NLS
|
||||
}
|
||||
finally{
|
||||
if (tempdbconnect != null) {
|
||||
tempdbconnect.closeConnection();
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user