Bug 285017 - Project Creation wizard does not check if folder is read only
Summary: Project Creation wizard does not check if folder is read only
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2009-07-29 11:02 EDT by Salvatore Culcasi CLA
Modified: 2020-09-04 15:18 EDT (History)
4 users (show)

See Also:


Attachments
patch for org.eclipse.core.resources (3.87 KB, patch)
2009-07-29 11:16 EDT, Salvatore Culcasi CLA
no flags Details | Diff
Patch v.0.1 (1.58 KB, patch)
2010-10-29 11:42 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff
CDT exception (6.34 KB, text/plain)
2010-11-18 16:42 EST, James Blackburn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore Culcasi CLA 2009-07-29 11:02:17 EDT
Build ID:  I20090611-1540

Steps To Reproduce:
1.Create a project:
Choose the File->New -> Project... ->General->Project wizard
2.Uncheck the "use Default location
3.Browse and select a read only directory 
4.Add a project name
5.Select finish and now an error dialog is raised

If in step 1 has been chosen a C (C++) project the step 5 is silent, thus the is not aware of the problem


More information:
I think the user should be advised that the directory selected has not write access, this advise should not be dependent on the project wizard chosen.
I added an attempt of a patch for org.eclipse.core.resources plugin

any advise is welcome
Comment 1 Salvatore Culcasi CLA 2009-07-29 11:16:37 EDT
Created attachment 142900 [details]
patch for org.eclipse.core.resources
Comment 2 Szymon Brandys CLA 2009-07-29 12:57:41 EDT
Thanks Salvatore for looking at this. You see the problem on Linux, right? Instead of creating a temporary file, we could check the resource attributes, see IResource#getResourceAttributes().
Comment 3 John Arthorne CLA 2009-07-29 12:59:54 EDT
I'm not sure if this is still the case, but at one point it was possible to create a project in a read only directory, such as on a CD/DVD, as long as the project location already contained a .project file. It seems like a strange case but we have had requests to support this before. It may be an option to return a warning instead of an error.
Comment 4 Salvatore Culcasi CLA 2009-08-07 10:37:50 EDT
(In reply to comment #3)
> I'm not sure if this is still the case, but at one point it was possible to
> create a project in a read only directory, such as on a CD/DVD, as long as the
> project location already contained a .project file. It seems like a strange
> case but we have had requests to support this before. It may be an option to
> return a warning instead of an error.
> 

Sorry for the late answer to your remarks

Szymon: If I understood IResource objects are workspace resources, in this case 
        the folder is not part of the workspace. If not please could you point me 
        to the right solution/example? 

John: I was not aware of this "feature". Howevetr anything I return from the   
       validateProjectLocationURI is used to create and "error". I did not find a 
      way to set just a warning. Any suggestion is welcome

thanks
Comment 5 Szymon Ptaszkiewicz CLA 2010-10-14 11:41:46 EDT
Salvatore, by "read only" do you mean folder attribute (like hidden) or security permissions allowing only read and denying write access?
Comment 6 Salvatore Culcasi CLA 2010-10-27 09:43:16 EDT
(In reply to comment #5)
> Salvatore, by "read only" do you mean folder attribute (like hidden) or
> security permissions allowing only read and denying write access?

I mean the "read only" access right as provided in Linux OS.
Under windows, you can emulate the same behaviour playing with Security Permission  settings
Comment 7 Szymon Ptaszkiewicz CLA 2010-10-29 11:42:38 EDT
Created attachment 182059 [details]
Patch v.0.1

I think this is something that Szymon B. had on mind. Unfortunately, it does not work in my case (WinXP). I am not sure if this is a problem with implementation of the patch or I tested it in the wrong way. Any comments are welcome.
Comment 8 Szymon Brandys CLA 2010-11-04 08:30:10 EDT
(In reply to comment #7)
> I think this is something that Szymon B. had on mind. Unfortunately, it does
> not work in my case (WinXP). I am not sure if this is a problem with
> implementation of the patch or I tested it in the wrong way. Any comments are
> welcome.

As John mentioned, we are able to create projects in read-only locations, if .project is already there. I think we do the right thing now, I'm just not sure why we don't see the error on C/C++ project creation. I would move it to CDT.
Comment 9 James Blackburn CLA 2010-11-18 16:42:42 EST
Created attachment 183433 [details]
CDT exception

In CDT trying to create a project on a read-only filesystem silently logs an error to the error log.

We should probably behave better and display an error dialog like the platform does.