mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
bug #1252: escape auth parameters
This commit is contained in:
1 parent
3b3ec9d14d
commit
ad9b493789
1 file changed
+4
-1
@@ -32,6 +32,7 @@ $: << RUBY_LIB_LOCATION
|
||||
require 'scripts_common'
|
||||
require 'OpenNebulaDriver'
|
||||
require 'getoptlong'
|
||||
require 'shellwords'
|
||||
|
||||
# This is a generic AuthZ/AuthN driver able to manage multiple authentication
|
||||
# protocols (simultaneosly). It also supports the definition of custom
|
||||
@@ -110,7 +111,9 @@ class AuthDriver < OpenNebulaDriver
|
||||
authN_path = File.join(@local_scripts_path, driver)
|
||||
|
||||
command = File.join(authN_path, ACTION[:authN].downcase)
|
||||
command << " '" << user.gsub("'", '\'"\'"\'') << "' '" << password.gsub("'", '\'"\'"\'') << "' " << secret
|
||||
command << ([user, password, secret].map do |p|
|
||||
Shellwords.escape(p)
|
||||
end.join(' '))
|
||||
|
||||
rc = LocalCommand.run(command, log_method(request_id))
|
||||
|
||||
|
||||
Reference in new issue
Block a user