Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Project creation UI workflow requires validation #78

Open
owenbyrne opened this issue Nov 9, 2011 · 2 comments
Open

Project creation UI workflow requires validation #78

owenbyrne opened this issue Nov 9, 2011 · 2 comments
Milestone

Comments

@owenbyrne
Copy link
Contributor

The project creation workflow through the UI (Add Project view etc.) requires validation as it's currently possible to rm -rf the ~/.cruise/projects directory by adding a blank project.

To reproduce:
1 - Add Project view
2 - Click create

Params should look like:

     "project"=>{"name"=>"",
     "source_control"=>{"repository"=>"",
     "source_control"=>"Git"}}}

SourceControl.create checks for nil instead of blank, so no exception is raised.
raise ArgumentError, "options should include repository" unless scm_options[:repository]

Project.create catches an exception trying to checkout a local copy, given there's no project name it rm -rf the project directory in the rescue.

```FileUtils.rm_rf "#{dir}/#{project.name}"````

@bguthrie
Copy link
Contributor

This is definitely alarming; thanks for the report. Taking a look now.

@emilsoman
Copy link
Contributor

Thanks @eightbitraptor for posting the link to the fix . @bguthrie : Why is this fix not yet taken ? It's a very serious issue , in my opinion .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants