-
Notifications
You must be signed in to change notification settings - Fork 640
Modified photorec and regripper modules in autopsy to work on linux #3429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…into jvm_option
| // Must be running under a Windows operating system. | ||
| if (!PlatformUtil.isWindowsOS()) { | ||
| throw new IngestModule.IngestModuleException(Bundle.unsupportedOS_message()); | ||
| public static File locateExecutable() throws IngestModule.IngestModuleException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is throwing IOException? We should probably catch that in this method and deal with it appropriately.
| }else if(usrLocalBin.canExecute() && usrLocalBin.exists() && !usrLocalBin.isDirectory()){ | ||
| photorec_linux_directory = "/usr/local/bin"; | ||
| }else{ | ||
| exeFile = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should throw IngestModule.IngestModuleException with message that photorec exe can not be found.
| }else if(usrLocalBin.canExecute() && usrLocalBin.exists() && !usrLocalBin.isDirectory()){ | ||
| PERL = "/usr/local/bin/perl"; | ||
| }else{ | ||
| throw new FileNotFoundException("perl not found in your system"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should throw IngestModuleException.
| final private static String RIP_EXE = "rip.exe"; | ||
| final private static String RIP_PL = "rip.pl"; | ||
| final private static String PERL = "perl "; | ||
| private static String PERL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This no longer needs to be defined up here. It can be a variable in the method.
| try { | ||
| registry = new ExtractRegistry(); | ||
| } catch (FileNotFoundException ex) { | ||
| Exceptions.printStackTrace(ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should all go away when we throw only IngestModuleExceptions. And, we should never just print the stack. We need to log it or act on it.
bcarrier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments added.
| // Scan the file with Unallocated Carver. | ||
| ProcessBuilder processAndSettings = new ProcessBuilder( | ||
| "\"" + executableFile + "\"", | ||
| executableFile.toString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the logic behind removing quotes around strings? Does this continue to work on Windows when there are spaces in the paths?
Other add-ons:
Win32:Registry in third party regripper directory
modified jvm_options in build.xml