Skip to content
Snippets Groups Projects
Commit 9663f235 authored by apriestman's avatar apriestman
Browse files

Don't open new connection for os account instance

parent 8d88cfff
No related branches found
No related tags found
No related merge requests found
...@@ -386,7 +386,10 @@ private long addBatchedFilesToDb() { ...@@ -386,7 +386,10 @@ private long addBatchedFilesToDb() {
// Currently we expect only NTFS systems to provide a windows style SID as owner id. // Currently we expect only NTFS systems to provide a windows style SID as owner id.
OsAccountManager accountMgr = caseDb.getOsAccountManager(); OsAccountManager accountMgr = caseDb.getOsAccountManager();
OsAccount newAccount = accountMgr.newWindowsOsAccount(ownerUid, null, null, imageHost, OsAccountRealm.RealmScope.UNKNOWN); OsAccount newAccount = accountMgr.newWindowsOsAccount(ownerUid, null, null, imageHost, OsAccountRealm.RealmScope.UNKNOWN);
accountMgr.newOsAccountInstance(newAccount.getId(), fileInfo.dataSourceObjId, OsAccountInstance.OsAccountInstanceType.LAUNCHED, caseDb.getConnection()); Content ds = caseDb.getContentById(fileInfo.dataSourceObjId); // Data sources are cached so this will only access the database once
if (ds instanceof DataSource) {
accountMgr.newOsAccountInstance(newAccount, (DataSource)ds, OsAccountInstance.OsAccountInstanceType.LAUNCHED);
}
ownerIdToAccountMap.put(ownerUid, newAccount); ownerIdToAccountMap.put(ownerUid, newAccount);
} }
} catch (NotUserSIDException ex) { } catch (NotUserSIDException ex) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment