bundler root path should be escaped #1789

Merged
merged 1 commit into from Mar 23, 2012

Conversation

Projects
None yet
3 participants
Contributor

tenderlove commented Mar 23, 2012

I don't know how to write a test for this, but if you create a rails application under a directory that has regular expression characters in it, bundler will break.

Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/source.rb:422:in `relative_path': empty char-class: /^\/Users\/aaron\/git\/foo[]bar\/lolwut/ (RegexpError)
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/source.rb:308:in `to_lock'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/definition.rb:254:in `block in to_lock'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/definition.rb:252:in `each'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/definition.rb:252:in `to_lock'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/definition.rb:233:in `lock'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/environment.rb:39:in `lock'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/installer.rb:59:in `run'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/installer.rb:12:in `install'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/cli.rb:220:in `install'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/bin/bundle:13:in `<top (required)>'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/bin/bundle:19:in `load'
    from /Users/aaron/.rvm/gems/ruby-1.9.3-p125/bin/bundle:19:in `<main>

This pull request escapes the directory name before it's used in a regexp.

sferik added a commit that referenced this pull request Mar 23, 2012

Merge pull request #1789 from tenderlove/pathescape
bundler root path should be escaped

@sferik sferik merged commit d6f93f8 into bundler:master Mar 23, 2012

hone added a commit that referenced this pull request Mar 23, 2012

Owner

indirect commented Mar 23, 2012

@sferik, thanks for being on top of this, but please please please never merge things without tests. We will just break it again later (or break something else because there's no test). If you're going to merge a pull without a test, write the test, then merge the fix. :)

On a slightly related note, our merge policy means that this should go into the 1-1-stable branch (with a test), and not get merged directly into master. If you have any questions about the merge policy, or future merges, don't hesitate to ping hone or myself. Thanks!

indirect added a commit that referenced this pull request Mar 24, 2012

Revert "Merge pull request #1789 from tenderlove/pathescape"
This reverts commit d6f93f8, reversing
changes made to f65ba39.
Member

sferik commented Mar 24, 2012

@indirect Thanks for bringing me up to speed on the policy.
@hone Thanks for writing the test.

I'll be more careful about merging things in the future. Sorry for the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment