Merge pull request #83 from abf/rosa-build:81-remove_entry_secure-does-not-work

[refs #81]: ArgumentError: parent directory is world writable, FileUtils#remove_entry_secure does not work
This commit is contained in:
warpc 2013-04-09 19:41:26 +04:00
commit 0035d54fe2
1 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,9 @@ class KeyPair < ActiveRecord::Base
protected
def check_keys
dir = Dir.mktmpdir('keys-', "#{APP_CONFIG['root_path']}/tmp")
tmp = "#{APP_CONFIG['root_path']}/tmp"
system "sudo chown `whoami` #{tmp} && chmod 1777 #{tmp}"
dir = Dir.mktmpdir('keys-', tmp)
begin
%w(pubring secring).each do |kind|
filename = "#{dir}/#{kind}"