mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
sqlplus credentials could contain special symbols and need to be escaped (#2308)
Signed-off-by: Dmytro Malovany <dmytro.malovannyy@gmail.com>
This commit is contained in:
parent
c5130621f3
commit
923e4abf21
2 changed files with 4 additions and 2 deletions
|
@ -60,7 +60,9 @@ module Inspec::Resources
|
|||
p = :parse_html_result
|
||||
end
|
||||
|
||||
command = "echo \"#{opts}\n#{verify_query(escaped_query)}\nEXIT\" | #{bin} -s #{@user}/#{@password}@//#{@host}:#{@port}/#{@service}"
|
||||
query = verify_query(escaped_query)
|
||||
query += ';' unless query.end_with?(';')
|
||||
command = %{echo "#{opts}\n#{query}\nEXIT" | #{bin} "#{@user}"/"#{@password}"@#{@host}:#{@port}/#{@service}}
|
||||
cmd = inspec.command(command)
|
||||
|
||||
out = cmd.stdout + "\n" + cmd.stderr
|
||||
|
|
|
@ -416,7 +416,7 @@ class MockLoader
|
|||
"5c2bc0f0568d11451d6cf83aff02ee3d47211265b52b6c5d45f8e57290b35082" => cmd.call('mssql-getdate'),
|
||||
# oracle
|
||||
"bash -c 'type \"sqlplus\"'" => cmd.call('oracle-cmd'),
|
||||
"ef04e5199abee80e662cc0dd1dd3bf3e0aaae9b4498217d241db00b413820911" => cmd.call('oracle-result'),
|
||||
"527f243fe9b01fc7b7d78eb1ef5200e272b011aa07c9f59836d950107d6d2a5c" => cmd.call('oracle-result'),
|
||||
# nginx mock cmd
|
||||
%{nginx -V 2>&1} => cmd.call('nginx-v'),
|
||||
%{/usr/sbin/nginx -V 2>&1} => cmd.call('nginx-v'),
|
||||
|
|
Loading…
Reference in a new issue