rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

Incorrect local storage for temporary session files #27

Closed brodock closed 12 years ago

brodock commented 12 years ago

As of this bug dated 2008: http://code.google.com/p/rubycas-client/issues/detail?id=23 the problem went back in Rails 3.1:

The following line (storage.rb 72):

    DEFAULT_TMP_DIR = defined?(Rails.root) ? "#{Rails.root}/tmp" : "#{Dir.pwd}/tmp"

Will return "/tmp" because Rails.root will not be defined at that run time.

The solution that best repaired it was removing the constant and putting it as a local variable inside initialize method, maintaining the functionality and repairing the wrong behaviour.

FYI, I'm using Rails 3.1 with Ruby 1.9.3-p0

I will attach a pull request in a minutes

soupmatt commented 12 years ago

Fixed on master. Will go out in 2.3.7.