cruisecontrol.rb
cruisecontrol.rb copied to clipboard
Project creation UI workflow requires validation
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}"````
This is definitely alarming; thanks for the report. Taking a look now.
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 .