1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-04 06:50:00 +00:00

Fix updating of central repo dbs.

Added display name.
Fixed default enabled status.
This commit is contained in:
Ann Priestman
2017-10-31 11:00:07 -04:00
parent ac6b4e68ee
commit bfa9502fa2
4 changed files with 37 additions and 9 deletions

View File

@@ -869,12 +869,16 @@ public class HashDbManager implements PropertyChangeListener {
};
public String getHashSetName();
public String getDisplayName();
public String getDatabasePath() throws TskCoreException;
public HashDb.KnownFilesType getKnownFilesType();
public boolean getSearchDuringIngest();
public boolean getDefaultSearchDuringIngest();
void setSearchDuringIngest(boolean useForIngest);
@@ -1015,6 +1019,11 @@ public class HashDbManager implements PropertyChangeListener {
public String getHashSetName() {
return hashSetName;
}
@Override
public String getDisplayName(){
return getHashSetName();
}
@Override
public String getDatabasePath() throws TskCoreException {
@@ -1043,6 +1052,12 @@ public class HashDbManager implements PropertyChangeListener {
public boolean getSearchDuringIngest() {
return searchDuringIngest;
}
@Override
public boolean getDefaultSearchDuringIngest(){
// File type hash sets are on by default
return true;
}
@Override
public void setSearchDuringIngest(boolean useForIngest) {
@@ -1304,6 +1319,11 @@ public class HashDbManager implements PropertyChangeListener {
return hashSetName;
}
@Override
public String getDisplayName(){
return getHashSetName() + " " + getVersion();
}
public String getVersion(){
return version;
}
@@ -1339,6 +1359,12 @@ public class HashDbManager implements PropertyChangeListener {
public boolean getSearchDuringIngest() {
return searchDuringIngest;
}
@Override
public boolean getDefaultSearchDuringIngest(){
// Central repo hash sets are off by default
return false;
}
@Override
public void setSearchDuringIngest(boolean useForIngest) {

View File

@@ -122,7 +122,7 @@ final class HashLookupModuleSettings implements IngestModuleIngestJobSettings {
/**
* Checks whether or not a hash set is enabled. If there is no setting for
* the requested hash set, it is deemed to be enabled.
* the requested hash set, return the default value
*
* @param db The hash set to check.
*
@@ -135,8 +135,8 @@ final class HashLookupModuleSettings implements IngestModuleIngestJobSettings {
}
}
// We didn't find it, so return true
return true;
// We didn't find it, so use the default value
return db.getDefaultSearchDuringIngest();
}
/**

View File

@@ -200,7 +200,7 @@ public final class HashLookupModuleSettingsPanel extends IngestModuleIngestJobSe
}
String getName() {
return db.getHashSetName();
return db.getDisplayName();
}
void setEnabled(boolean enabled) {

View File

@@ -40,6 +40,7 @@ import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.events.AutopsyEvent;
@@ -266,7 +267,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
// Update ingest option components.
sendIngestMessagesCheckBox.setSelected(db.getSendIngestMessages());
sendIngestMessagesCheckBox.setEnabled(!ingestIsRunning && db.getSearchDuringIngest() && db.getKnownFilesType().equals(KnownFilesType.KNOWN_BAD));
sendIngestMessagesCheckBox.setEnabled(!ingestIsRunning && db.getKnownFilesType().equals(KnownFilesType.KNOWN_BAD));
optionsLabel.setEnabled(!ingestIsRunning);
optionsSeparator.setEnabled(!ingestIsRunning);
@@ -357,11 +358,12 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
if(EamDb.isEnabled()){
EamDb.getInstance().deleteReferenceSet(index);
} else {
xx
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex); //NON-NLS
// This is the case where the user imported a database, then switched over to the central
// repo panel and disabled it before cancelling. We can't delete the database at this point.
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.WARNING, "Error reverting central repository hash sets"); //NON-NLS
}
} catch (EamDbException ex){
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error reverting central repository hash sets", ex); //NON-NLS
}
}
@@ -546,7 +548,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
}
void refreshModel() {
hashSets = HashDbManager.getInstance().getAllHashDatabases();
hashSets = HashDbManager.getInstance().refreshAndGetAllHashDatabases();
refreshDisplay();
}