Merge remote-tracking branch 'origin/GP-186_dragonmacher_PR-2314_ryanmkurtz_GhidraDev_projectDirCheck'

This commit is contained in:
ghidravore
2020-09-28 13:43:40 -04:00
2 changed files with 14 additions and 5 deletions
@@ -53,8 +53,16 @@ change with future releases.</p>
</ul> </ul>
<h2><a name="ChangeHistory"></a>Change History</h2> <h2><a name="ChangeHistory"></a>Change History</h2>
<p><u><b>2.1.1</b>:</u> Python debugging now works when PyDev is installed via the Eclipse "dropins" <p><u><b>2.1.1</b>:</u>
directory.</p> <ul>
<li>
Python debugging now works when PyDev is installed via the Eclipse "dropins" directory.
</li>
<li>
Fixed a bug in the check that prevents Ghidra projects from being created within the Ghidra
installation directory.
</li>
</ul>
<p><u><b>2.1.0</b>:</u> <p><u><b>2.1.0</b>:</u>
<ul> <ul>
<li> <li>
@@ -37,6 +37,7 @@ import ghidradev.EclipseMessageUtils;
import ghidradev.ghidraprojectcreator.utils.GhidraModuleUtils; import ghidradev.ghidraprojectcreator.utils.GhidraModuleUtils;
import ghidradev.ghidraprojectcreator.utils.GhidraModuleUtils.ModuleTemplateType; import ghidradev.ghidraprojectcreator.utils.GhidraModuleUtils.ModuleTemplateType;
import ghidradev.ghidraprojectcreator.wizards.pages.*; import ghidradev.ghidraprojectcreator.wizards.pages.*;
import utilities.util.FileUtilities;
/** /**
* Wizard to create a new Ghidra module project. * Wizard to create a new Ghidra module project.
@@ -160,10 +161,10 @@ public class CreateGhidraModuleProjectWizard extends Wizard implements INewWizar
* @return True if the data returned from the wizard pages are valid; otherwise, false * @return True if the data returned from the wizard pages are valid; otherwise, false
*/ */
private boolean validate() { private boolean validate() {
if (projectPage.getProjectDir().getAbsolutePath().startsWith( if (FileUtilities.isPathContainedWithin(ghidraInstallationPage.getGhidraInstallDir(),
ghidraInstallationPage.getGhidraInstallDir().getAbsolutePath())) { projectPage.getProjectDir())) {
EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory", EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory",
"Project root directory cannot reside inside of the selected Ghidra installation directory."); "Project root directory cannot reside inside of the selected Ghidra installation directory.");
return false; return false;
} }
return true; return true;