Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
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
Sleuthkit
Commits
ffcac9e8
Commit
ffcac9e8
authored
13 years ago
by
Brian Carrier
Browse files
Options
Downloads
Patches
Plain Diff
more error checking on DB commit / revert
parent
177b9d86
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bindings/java/jni/dataModel_SleuthkitJNI.cpp
+10
-1
10 additions, 1 deletion
bindings/java/jni/dataModel_SleuthkitJNI.cpp
bindings/java/nbproject/project.xml
+151
-151
151 additions, 151 deletions
bindings/java/nbproject/project.xml
tsk3/auto/auto_db.cpp
+20
-2
20 additions, 2 deletions
tsk3/auto/auto_db.cpp
with
181 additions
and
154 deletions
bindings/java/jni/dataModel_SleuthkitJNI.cpp
+
10
−
1
View file @
ffcac9e8
...
...
@@ -370,7 +370,11 @@ JNIEXPORT void JNICALL
"revertAddImgNat: Invalid TskAutoDb object passed in"
);
return
;
}
tskAuto
->
revertAddImage
();
if
(
tskAuto
->
revertAddImage
())
{
throwTskError
(
env
,
"revertAddImgNat: Error reverting transaction"
);
return
;
}
delete
tskAuto
;
}
...
...
@@ -392,6 +396,11 @@ JNIEXPORT jlong JNICALL
}
int64_t
imgId
=
tskAuto
->
commitAddImage
();
delete
tskAuto
;
if
(
imgId
==
-
1
)
{
throwTskError
(
env
,
"commit addImgNat: Error commiting image"
);
return
-
1
;
}
return
imgId
;
}
...
...
This diff is collapsed.
Click to expand it.
bindings/java/nbproject/project.xml
100644 → 100755
+
151
−
151
View file @
ffcac9e8
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://www.netbeans.org/ns/project/1"
>
<type>
org.netbeans.modules.ant.freeform
</type>
<configuration>
<general-data
xmlns=
"http://www.netbeans.org/ns/freeform-project/1"
>
<name>
DataModel
</name>
</general-data>
<general-data
xmlns=
"http://www.netbeans.org/ns/freeform-project/2"
>
<!-- Do not use Project Properties customizer when editing this file manually. -->
<name>
DataModel
</name>
<properties/>
<folders>
<source-folder>
<label>
DataModel
</label>
<location>
.
</location>
<encoding>
windows-1252
</encoding>
</source-folder>
<source-folder>
<label>
src
</label>
<type>
java
</type>
<location>
src
</location>
<encoding>
windows-1252
</encoding>
</source-folder>
<source-folder>
<label>
test
</label>
<type>
java
</type>
<location>
test
</location>
<encoding>
windows-1252
</encoding>
</source-folder>
</folders>
<ide-actions>
<action
name=
"build"
>
<target>
compile
</target>
</action>
<action
name=
"clean"
>
<target>
clean
</target>
</action>
<action
name=
"rebuild"
>
<target>
clean
</target>
<target>
compile
</target>
</action>
<action
name=
"run.single"
>
<script>
nbproject/ide-file-targets.xml
</script>
<target>
run-selected-file-in-test
</target>
<context>
<property>
run.class
</property>
<folder>
test
</folder>
<pattern>
\.java$
</pattern>
<format>
java-name
</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
<action
name=
"compile.single"
>
<script>
nbproject/ide-file-targets.xml
</script>
<target>
compile-selected-files-in-test
</target>
<context>
<property>
files
</property>
<folder>
test
</folder>
<pattern>
\.java$
</pattern>
<format>
relative-path
</format>
<arity>
<separated-files>
,
</separated-files>
</arity>
</context>
</action>
<action
name=
"test"
>
<target>
test
</target>
</action>
</ide-actions>
<export>
<type>
folder
</type>
<location>
build
</location>
<build-target>
compile
</build-target>
</export>
<export>
<type>
folder
</type>
<location>
build
</location>
<build-target>
compile
</build-target>
</export>
<export>
<type>
folder
</type>
<location>
test
</location>
<build-target>
compile
</build-target>
</export>
<view>
<items>
<source-folder
style=
"packages"
>
<label>
src
</label>
<location>
src
</location>
</source-folder>
<source-folder
style=
"packages"
>
<label>
test
</label>
<location>
test
</location>
</source-folder>
<source-file>
<location>
build.xml
</location>
</source-file>
</items>
<context-menu>
<ide-action
name=
"build"
/>
<ide-action
name=
"rebuild"
/>
<ide-action
name=
"clean"
/>
<ide-action
name=
"test"
/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data
xmlns=
"http://www.netbeans.org/ns/freeform-project-java/3"
>
<compilation-unit>
<package-root>
src
</package-root>
<classpath
mode=
"compile"
>
lib;lib/diffutils-1.2.1.jar
</classpath>
<built-to>
build
</built-to>
<source-level>
1.6
</source-level>
</compilation-unit>
<compilation-unit>
<package-root>
test
</package-root>
<unit-tests/>
<classpath
mode=
"compile"
>
build;lib/diffutils-1.2.1.jar;lib/diffutils-1.2.1-javadoc.jar;lib/diffutils-1.2.1-sources.jar;lib/junit-4.8.2.jar
</classpath>
<built-to>
build
</built-to>
<built-to>
test
</built-to>
<source-level>
1.6
</source-level>
</compilation-unit>
</java-data>
<preferences
xmlns=
"http://www.netbeans.org/ns/auxiliary-configuration-preferences/1"
>
<module
name=
"org-netbeans-modules-html-editor-lib"
/>
<module
name=
"org-netbeans-modules-editor-indent"
>
<node
name=
"CodeStyle"
>
<property
name=
"usedProfile"
value=
"project"
/>
<node
name=
"project"
>
<property
name=
"spaces-per-tab"
value=
"4"
/>
<property
name=
"tab-size"
value=
"4"
/>
<property
name=
"indent-shift-width"
value=
"4"
/>
<property
name=
"expand-tabs"
value=
"false"
/>
<property
name=
"text-limit-width"
value=
"80"
/>
<property
name=
"text-line-wrap"
value=
"none"
/>
</node>
</node>
<node
name=
"text"
>
<node
name=
"x-java"
>
<node
name=
"CodeStyle"
>
<node
name=
"project"
/>
</node>
</node>
</node>
</module>
<module
name=
"org-netbeans-modules-projectimport-eclipse-core"
/>
</preferences>
</configuration>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://www.netbeans.org/ns/project/1"
>
<type>
org.netbeans.modules.ant.freeform
</type>
<configuration>
<general-data
xmlns=
"http://www.netbeans.org/ns/freeform-project/1"
>
<name>
DataModel
</name>
</general-data>
<general-data
xmlns=
"http://www.netbeans.org/ns/freeform-project/2"
>
<!-- Do not use Project Properties customizer when editing this file manually. -->
<name>
DataModel
</name>
<properties/>
<folders>
<source-folder>
<label>
DataModel
</label>
<location>
.
</location>
<encoding>
windows-1252
</encoding>
</source-folder>
<source-folder>
<label>
src
</label>
<type>
java
</type>
<location>
src
</location>
<encoding>
windows-1252
</encoding>
</source-folder>
<source-folder>
<label>
test
</label>
<type>
java
</type>
<location>
test
</location>
<encoding>
windows-1252
</encoding>
</source-folder>
</folders>
<ide-actions>
<action
name=
"build"
>
<target>
dist
</target>
</action>
<action
name=
"clean"
>
<target>
clean
</target>
</action>
<action
name=
"rebuild"
>
<target>
clean
</target>
<target>
dist
</target>
</action>
<action
name=
"run.single"
>
<script>
nbproject/ide-file-targets.xml
</script>
<target>
run-selected-file-in-test
</target>
<context>
<property>
run.class
</property>
<folder>
test
</folder>
<pattern>
\.java$
</pattern>
<format>
java-name
</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
<action
name=
"compile.single"
>
<script>
nbproject/ide-file-targets.xml
</script>
<target>
compile-selected-files-in-test
</target>
<context>
<property>
files
</property>
<folder>
test
</folder>
<pattern>
\.java$
</pattern>
<format>
relative-path
</format>
<arity>
<separated-files>
,
</separated-files>
</arity>
</context>
</action>
<action
name=
"test"
>
<target>
test
</target>
</action>
</ide-actions>
<export>
<type>
folder
</type>
<location>
build
</location>
<build-target>
compile
</build-target>
</export>
<export>
<type>
folder
</type>
<location>
build
</location>
<build-target>
compile
</build-target>
</export>
<export>
<type>
folder
</type>
<location>
test
</location>
<build-target>
compile
</build-target>
</export>
<view>
<items>
<source-folder
style=
"packages"
>
<label>
src
</label>
<location>
src
</location>
</source-folder>
<source-folder
style=
"packages"
>
<label>
test
</label>
<location>
test
</location>
</source-folder>
<source-file>
<location>
build.xml
</location>
</source-file>
</items>
<context-menu>
<ide-action
name=
"build"
/>
<ide-action
name=
"rebuild"
/>
<ide-action
name=
"clean"
/>
<ide-action
name=
"test"
/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data
xmlns=
"http://www.netbeans.org/ns/freeform-project-java/3"
>
<compilation-unit>
<package-root>
src
</package-root>
<classpath
mode=
"compile"
>
lib;lib/diffutils-1.2.1.jar
</classpath>
<built-to>
build
</built-to>
<source-level>
1.6
</source-level>
</compilation-unit>
<compilation-unit>
<package-root>
test
</package-root>
<unit-tests/>
<classpath
mode=
"compile"
>
build;lib/diffutils-1.2.1.jar;lib/diffutils-1.2.1-javadoc.jar;lib/diffutils-1.2.1-sources.jar;lib/junit-4.8.2.jar
</classpath>
<built-to>
build
</built-to>
<built-to>
test
</built-to>
<source-level>
1.6
</source-level>
</compilation-unit>
</java-data>
<preferences
xmlns=
"http://www.netbeans.org/ns/auxiliary-configuration-preferences/1"
>
<module
name=
"org-netbeans-modules-html-editor-lib"
/>
<module
name=
"org-netbeans-modules-editor-indent"
>
<node
name=
"CodeStyle"
>
<property
name=
"usedProfile"
value=
"project"
/>
<node
name=
"project"
>
<property
name=
"spaces-per-tab"
value=
"4"
/>
<property
name=
"tab-size"
value=
"4"
/>
<property
name=
"indent-shift-width"
value=
"4"
/>
<property
name=
"expand-tabs"
value=
"false"
/>
<property
name=
"text-limit-width"
value=
"80"
/>
<property
name=
"text-line-wrap"
value=
"none"
/>
</node>
</node>
<node
name=
"text"
>
<node
name=
"x-java"
>
<node
name=
"CodeStyle"
>
<node
name=
"project"
/>
</node>
</node>
</node>
</module>
<module
name=
"org-netbeans-modules-projectimport-eclipse-core"
/>
</preferences>
</configuration>
</project>
This diff is collapsed.
Click to expand it.
tsk3/auto/auto_db.cpp
+
20
−
2
View file @
ffcac9e8
...
...
@@ -362,10 +362,18 @@ void
/**
* Revert all changes after the process has run sucessfully.
* @returns 1 on error, 0 on success
*/
int
TskAutoDb
::
revertAddImage
()
{
if
(
m_imgTransactionOpen
==
false
)
{
tsk_error_reset
();
tsk_error_set_errno
(
TSK_ERR_AUTO_DB
);
tsk_error_set_errstr
(
"revertAddImage(): transaction is already closed"
);
return
1
;
}
int
retval
=
m_db
->
revertSavepoint
(
TSK_ADD_IMAGE_SAVEPOINT
);
m_imgTransactionOpen
=
false
;
return
retval
;
...
...
@@ -373,13 +381,23 @@ int
/**
* Finish the process after it has run sucessfully by committing the changes.
*
R
eturns
the i
d of the image that was added
.
*
@r
eturns
I
d of the image that was added
or -1 on error
*/
int64_t
TskAutoDb
::
commitAddImage
()
{
m_db
->
releaseSavepoint
(
TSK_ADD_IMAGE_SAVEPOINT
);
if
(
m_imgTransactionOpen
==
false
)
{
tsk_error_reset
();
tsk_error_set_errno
(
TSK_ERR_AUTO_DB
);
tsk_error_set_errstr
(
"commitAddImage(): transaction is already closed"
);
return
-
1
;
}
int
retval
=
m_db
->
releaseSavepoint
(
TSK_ADD_IMAGE_SAVEPOINT
);
m_imgTransactionOpen
=
false
;
if
(
retval
==
1
)
{
return
-
1
;
}
return
m_curImgId
;
}
...
...
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