Project

General

Profile

Actions

Defect #9137

closed

db:encrypt fails to handle repositories with blank password

Added by Marc Dequènes over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
Start date:
2011-08-27
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I got this result:

# rake db:encrypt RAILS_ENV=production --trace
(in /www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0)
NOTE: SourceIndex.new(hash) is deprecated; From /www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
** Invoke db:encrypt (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:encrypt
rake aborted!
data must not be empty
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:34:in `update'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:34:in `encrypt_text'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:92:in `write_ciphered_attribute'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/app/models/repository.rb:58:in `password='
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:66:in `send'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:66:in `encrypt_all'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:64:in `each'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:64:in `encrypt_all'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/redmine/ciphering.rb:63:in `encrypt_all'
/www/sites/duckcorp/projects.duckcorp.org/redmine-1.2.0/lib/tasks/ciphering.rake:22
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

In my database, the 'login' and 'passwords' of all 'repositories' are empty strings (not NULL, but not sure it makes a difference). Trying to encrypt such an empty string later fails. The one-liner attached patch fixes this issue.


Files

db_encrypt_failure.patch (481 Bytes) db_encrypt_failure.patch Marc Dequènes, 2011-08-27 12:17
Actions #1

Updated by Etienne Massip over 12 years ago

  • Target version set to Candidate for next minor release
Actions #2

Updated by Jean-Philippe Lang over 12 years ago

  • Subject changed from db:encrypt fails to handle repositories without auth to db:encrypt fails to handle repositories with blank password
  • Status changed from New to Resolved
  • Target version changed from Candidate for next minor release to 1.2.3
  • Resolution set to Fixed

Fixed in r7985.

Actions #3

Updated by Jean-Philippe Lang over 12 years ago

  • Status changed from Resolved to Closed

Merged in r7997.

Actions

Also available in: Atom PDF