Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorJeff Johnston2013-02-19 18:22:07 -0500
committerJeff Johnston2013-02-20 16:16:50 -0500
commit18ff30de24e745ca9f221c49ff8bd219837022c7 (patch)
treea3c29211fc06a2e738b2be12f17057d2d14cd77e /build
parent1908efec3811e8c24030a5b38140b00fbb66ca61 (diff)
downloadorg.eclipse.cdt-18ff30de24e745ca9f221c49ff8bd219837022c7.tar.gz
org.eclipse.cdt-18ff30de24e745ca9f221c49ff8bd219837022c7.tar.xz
org.eclipse.cdt-18ff30de24e745ca9f221c49ff8bd219837022c7.zip
Bug 400972: Creating new C/C++ project in existing read-only
directory should be disallowed Change-Id: I75090498bd4f408d77ad17491f50f4fd66850c97 Reviewed-on: https://git.eclipse.org/r/10404 Reviewed-by: Jesse Weinstein <Jesse.Weinstein@clinicomp.com> Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java5
3 files changed, 7 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
index 69436a7ed9..18939f441d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
@@ -186,6 +186,7 @@ public class Messages extends NLS {
public static String NewMakeProjFromExistingPage_7;
public static String NewMakeProjFromExistingPage_8;
public static String NewMakeProjFromExistingPage_9;
+ public static String NewMakeProjFromExistingPage_DirReadOnlyError;
public static String NewVarDialog_0;
public static String NewVarDialog_1;
public static String PreferredToolchainsTab_0;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
index ac4acf5dce..d45a0a1285 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
@@ -152,6 +152,8 @@ NewMakeProjFromExistingPage_6=Browse...
NewMakeProjFromExistingPage_7=Select root directory of existing code
NewMakeProjFromExistingPage_8=Not a valid directory
NewMakeProjFromExistingPage_9=Languages
+NewMakeProjFromExistingPage_DirReadOnlyError=Directory is read-only
+
# ----------- Configuration Selection Page -----------
BuildPropertyPage_error_Unknown_tree_element=Unknown type of element in tree of type {0}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java
index 8848e47386..b9f817f07b 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExistingPage.java
@@ -155,10 +155,13 @@ public class NewMakeProjFromExistingPage extends WizardPage {
else {
final File file= new File(loc);
if (file.isDirectory()) {
+ // Ensure we can create files in the directory.
+ if (!file.canWrite())
+ msg = Messages.NewMakeProjFromExistingPage_DirReadOnlyError;
// Set the project name to the directory name but not if the user has supplied a name
// (bugzilla 368987). Use a job to ensure proper sequence of activity, as setting the Text
// will invoke the listener, which will invoke this method.
- if (!projectNameSetByUser && !name.equals(file.getName())) {
+ else if (!projectNameSetByUser && !name.equals(file.getName())) {
WorkbenchJob wjob = new WorkbenchJob("update project name") { //$NON-NLS-1$
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {

Back to the top