mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Fixed RA NPE
This commit is contained in:
parent
e6c87a1bea
commit
a46bbb81a3
@ -742,7 +742,7 @@ class ExtractRegistry extends Extract {
|
||||
} else {
|
||||
results.get(0).addAttributes(bbattributes);
|
||||
}
|
||||
for (Map.Entry userMap : userNameMap.entrySet()) {
|
||||
for (Map.Entry userMap : getUserNameMap().entrySet()) {
|
||||
String sid = "";
|
||||
try{
|
||||
sid = (String)userMap.getKey();
|
||||
@ -1116,17 +1116,6 @@ class ExtractRegistry extends Extract {
|
||||
accountMgr.newOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED);
|
||||
updateOsAccount(osAccount, userInfo, groupMap.get(userInfo.get(SID_KEY)), regAbstractFile);
|
||||
}
|
||||
|
||||
// Get a mapping of user sids to user names and save globally so it can be used for other areas
|
||||
// of the registry, ie: BAM key
|
||||
try {
|
||||
userNameMap = makeUserNameMap(dataSource);
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.WARNING, "Unable to create OS Account user name map", ex);
|
||||
// This is not the end of the world we will just continue without
|
||||
// user names
|
||||
userNameMap = new HashMap<>();
|
||||
}
|
||||
return true;
|
||||
} catch (FileNotFoundException ex) {
|
||||
logger.log(Level.WARNING, "Error finding the registry file.", ex); //NON-NLS
|
||||
@ -1261,7 +1250,7 @@ class ExtractRegistry extends Extract {
|
||||
// We can add the S- back to the string that we split on since S- is a valid beginning of a User SID
|
||||
String fileNameSid[] = tokens[4].split("\\s+\\(S-");
|
||||
String userSid = "S-" + fileNameSid[1].substring(0, fileNameSid[1].length() - 1);
|
||||
String userName = userNameMap.get(userSid);
|
||||
String userName = getUserNameMap().get(userSid);
|
||||
if (userName == null) {
|
||||
userName = userSid;
|
||||
}
|
||||
@ -1738,6 +1727,23 @@ class ExtractRegistry extends Extract {
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private Map<String, String> getUserNameMap() {
|
||||
if(userNameMap == null) {
|
||||
// Get a mapping of user sids to user names and save globally so it can be used for other areas
|
||||
// of the registry, ie: BAM key
|
||||
try {
|
||||
userNameMap = makeUserNameMap(dataSource);
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.WARNING, "Unable to create OS Account user name map", ex);
|
||||
// This is not the end of the world we will just continue without
|
||||
// user names
|
||||
userNameMap = new HashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
return userNameMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the attribute for the given type from the given artifact.
|
||||
|
Loading…
x
Reference in New Issue
Block a user