diff --git a/src/cloud/ec2/lib/econe-server.rb b/src/cloud/ec2/lib/econe-server.rb index b500d9975c..6337c228e4 100644 --- a/src/cloud/ec2/lib/econe-server.rb +++ b/src/cloud/ec2/lib/econe-server.rb @@ -32,7 +32,7 @@ else end VIEWS_LOCATION = RUBY_LIB_LOCATION + "/cloud/econe/views" -EC2_AUTH = VAR_LOCATION + "/ec2_auth" +EC2_AUTH = VAR_LOCATION + "/.one/ec2_auth" $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" diff --git a/src/cloud/occi/lib/occi-server.rb b/src/cloud/occi/lib/occi-server.rb index ee8abec39c..86f9a1959b 100755 --- a/src/cloud/occi/lib/occi-server.rb +++ b/src/cloud/occi/lib/occi-server.rb @@ -36,7 +36,7 @@ else CONFIGURATION_FILE = ONE_LOCATION+"/etc/occi-server.conf" end -OCCI_AUTH = VAR_LOCATION + "/occi_auth" +OCCI_AUTH = VAR_LOCATION + "/.one/occi_auth" $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud/occi" diff --git a/src/onedb/3.0.0_to_3.1.0.rb b/src/onedb/3.0.0_to_3.1.0.rb index 18e415f291..c68b9122ed 100644 --- a/src/onedb/3.0.0_to_3.1.0.rb +++ b/src/onedb/3.0.0_to_3.1.0.rb @@ -191,21 +191,25 @@ module Migrator new_auth = "#{username}:#{pass}\n" begin + dir = "#{VAR_LOCATION}/.one" + if ( !File.directory?(dir) ) + Dir.mkdir(dir, 0700) + end + ["sunstone_auth", "occi_auth", "ec2_auth"].each { |name| - File.open("#{VAR_LOCATION}/#{name}", 'w') {|f| + File.open("#{dir}/#{name}", 'w', 0600) {|f| f.write(new_auth) } } rescue - puts "Error trying to create new configuration files in #{VAR_LOCATION}" + puts "Error trying to create new configuration files in #{dir}" return false end puts " > New user '#{username}' created "<< "for Sunstone and public servers operation.\n"<< - " You will need to create some configuration files "<< - "before Sunstone, OCCI or EC2 are "<< - "started.\n Visit\n"<< + " You have three new authentication files in #{dir}.\n"<< + " For more information, visit\n"<< " http://opennebula.org/documentation:rel3.2:upgrade" end diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 96214a9c61..56944d0425 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -31,7 +31,7 @@ else RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" end -SUNSTONE_AUTH = VAR_LOCATION + "/sunstone_auth" +SUNSTONE_AUTH = VAR_LOCATION + "/.one/sunstone_auth" CONFIGURATION_FILE = ETC_LOCATION + "/sunstone-server.conf" PLUGIN_CONFIGURATION_FILE = ETC_LOCATION + "/sunstone-plugins.yaml" diff --git a/src/um/UserPool.cc b/src/um/UserPool.cc index 66cee1b1bc..4943064497 100644 --- a/src/um/UserPool.cc +++ b/src/um/UserPool.cc @@ -132,9 +132,11 @@ UserPool::UserPool(SqlDB * db, random = SSLTools::sha1_digest( sstr.str() ); - filenames[0] = nd.get_var_location() + "/sunstone_auth"; - filenames[1] = nd.get_var_location() + "/occi_auth"; - filenames[2] = nd.get_var_location() + "/ec2_auth"; + filenames[0] = nd.get_var_location() + "/.one/sunstone_auth"; + filenames[1] = nd.get_var_location() + "/.one/occi_auth"; + filenames[2] = nd.get_var_location() + "/.one/ec2_auth"; + + mkdir(string(nd.get_var_location() + "/.one").c_str(), S_IRWXU); for (i=0 ; i < 3; i++) {