Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Autopsy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Autopsy
Commits
6972d805
Commit
6972d805
authored
3 years ago
by
Greg DiCristofaro
Browse files
Options
Downloads
Patches
Plain Diff
bug fixes
parent
0aada857
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Installer.java
+10
-2
10 additions, 2 deletions
...t/autopsy/centralrepository/eventlisteners/Installer.java
Core/src/org/sleuthkit/autopsy/ingest/Installer.java
+2
-1
2 additions, 1 deletion
Core/src/org/sleuthkit/autopsy/ingest/Installer.java
with
12 additions
and
3 deletions
Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Installer.java
+
10
−
2
View file @
6972d805
...
@@ -47,7 +47,8 @@
...
@@ -47,7 +47,8 @@
*/
*/
public
class
Installer
extends
ModuleInstall
{
public
class
Installer
extends
ModuleInstall
{
private
static
final
String
LEGACY_DEFAULT_DB_PARENT_PATH
=
Paths
.
get
(
PlatformUtil
.
getUserDirectory
().
getAbsolutePath
(),
"central_repository"
).
toAbsolutePath
().
toString
();
private
static
final
String
LEGACY_DEFAULT_FOLDER
=
"central_repository"
;
private
static
final
String
LEGACY_DEFAULT_DB_PARENT_PATH
=
Paths
.
get
(
PlatformUtil
.
getUserDirectory
().
getAbsolutePath
(),
LEGACY_DEFAULT_FOLDER
).
toAbsolutePath
().
toString
();
//private static final String LEGACY_DEFAULT_DB_NAME = "central_repository.db";
//private static final String LEGACY_DEFAULT_DB_NAME = "central_repository.db";
private
static
final
String
LEGACY_MODULE_SETTINGS_KEY
=
"CentralRepository"
;
private
static
final
String
LEGACY_MODULE_SETTINGS_KEY
=
"CentralRepository"
;
...
@@ -104,8 +105,15 @@ private void upgradeSettingsPath() {
...
@@ -104,8 +105,15 @@ private void upgradeSettingsPath() {
if
(!
newSettingsFile
.
exists
()
&&
legacySettingsFile
.
exists
())
{
if
(!
newSettingsFile
.
exists
()
&&
legacySettingsFile
.
exists
())
{
Map
<
String
,
String
>
prevSettings
=
ModuleSettings
.
getConfigSettings
(
LEGACY_MODULE_SETTINGS_KEY
);
Map
<
String
,
String
>
prevSettings
=
ModuleSettings
.
getConfigSettings
(
LEGACY_MODULE_SETTINGS_KEY
);
String
prevPath
=
prevSettings
.
get
(
SqliteCentralRepoSettings
.
getDatabasePathKey
());
String
prevPath
=
prevSettings
.
get
(
SqliteCentralRepoSettings
.
getDatabasePathKey
());
File
prevDirCheck
=
new
File
(
prevPath
);
// if a relative directory, make sure it is relative to user config.
if
(!
prevDirCheck
.
isAbsolute
())
{
prevPath
=
Paths
.
get
(
PlatformUtil
.
getUserDirectory
().
getAbsolutePath
(),
prevPath
).
toAbsolutePath
().
toString
();
}
// if old path is default path for sqlite db, copy it over to new location and update setting.
// if old path is default path for sqlite db, copy it over to new location and update setting.
if
(
prevPath
!=
null
&&
Paths
.
get
(
LEGACY_DEFAULT_DB_PARENT_PATH
).
equals
(
Paths
.
get
(
prevPath
).
toAbsolutePath
()))
{
if
(
prevPath
!=
null
&&
Paths
.
get
(
LEGACY_DEFAULT_DB_PARENT_PATH
).
toAbsolutePath
().
toString
().
equals
(
Paths
.
get
(
prevPath
).
toAbsolutePath
().
toString
()))
{
String
prevDbName
=
prevSettings
.
get
(
SqliteCentralRepoSettings
.
getDatabaseNameKey
());
String
prevDbName
=
prevSettings
.
get
(
SqliteCentralRepoSettings
.
getDatabaseNameKey
());
File
prevDir
=
new
File
(
prevPath
);
File
prevDir
=
new
File
(
prevPath
);
// copy all files starting with prevDbName in prevPath to new path location.
// copy all files starting with prevDbName in prevPath to new path location.
...
...
This diff is collapsed.
Click to expand it.
Core/src/org/sleuthkit/autopsy/ingest/Installer.java
+
2
−
1
View file @
6972d805
...
@@ -97,7 +97,8 @@ private void upgradeSettings() {
...
@@ -97,7 +97,8 @@ private void upgradeSettings() {
.
filter
(
e
->
e
.
getKey
()
!=
null
)
.
filter
(
e
->
e
.
getKey
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getKey
().
toString
(),
e
->
e
.
getValue
()
==
null
?
null
:
e
.
getValue
().
toString
(),
(
v1
,
v2
)
->
v1
));
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getKey
().
toString
(),
e
->
e
.
getValue
()
==
null
?
null
:
e
.
getValue
().
toString
(),
(
v1
,
v2
)
->
v1
));
ModuleSettings
.
setConfigSettings
(
IngestJobSettings
.
getModuleSettingsResource
(
settingsName
),
moduleSettingsToSave
);
String
resourceName
=
isProfile
?
IngestProfiles
.
getExecutionContext
(
settingsName
)
:
settingsName
;
ModuleSettings
.
setConfigSettings
(
IngestJobSettings
.
getModuleSettingsResource
(
resourceName
),
moduleSettingsToSave
);
FileUtils
.
copyDirectory
(
moduleSettingsFolder
,
IngestJobSettings
.
getSavedModuleSettingsFolder
(
settingsName
).
toFile
());
FileUtils
.
copyDirectory
(
moduleSettingsFolder
,
IngestJobSettings
.
getSavedModuleSettingsFolder
(
settingsName
).
toFile
());
}
catch
(
IOException
ex
)
{
}
catch
(
IOException
ex
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment