Skip to content
Snippets Groups Projects
Commit 3b9280c2 authored by apriestman's avatar apriestman
Browse files

Delete os accounts from tsk_objects

parent 8a74fdf0
No related branches found
No related tags found
No related merge requests found
...@@ -9746,6 +9746,12 @@ void deleteDataSource(long dataSourceObjectId) throws TskCoreException { ...@@ -9746,6 +9746,12 @@ void deleteDataSource(long dataSourceObjectId) throws TskCoreException {
// realms, os accounts, and os account attributes that were associated with the host. // realms, os accounts, and os account attributes that were associated with the host.
if (hostToDelete != null) { if (hostToDelete != null) {
statement.execute("DELETE FROM tsk_hosts WHERE id = " + hostToDelete.getHostId()); statement.execute("DELETE FROM tsk_hosts WHERE id = " + hostToDelete.getHostId());
// Clean up any stray OS Account objects
String deleteOsAcctObjectsQuery = "DELETE FROM tsk_objects " +
"WHERE type=" + TskData.ObjectType.OS_ACCOUNT.getObjectType() + " " +
"AND obj_id NOT IN (SELECT os_account_obj_id FROM tsk_os_accounts WHERE os_account_obj_id IS NOT NULL)";
statement.execute(deleteOsAcctObjectsQuery);
} }
connection.commitTransaction(); connection.commitTransaction();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment