mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
bug #1385: ldap password is not shown on error log
This commit is contained in:
parent
2eab0ed9ce
commit
c17f7ac307
@ -85,6 +85,16 @@ class AuthDriver < OpenNebulaDriver
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Works the same as log_method but changes the password by '****'.
|
||||
# The last word is the password for authentication.
|
||||
def log_method_no_password(num, secret)
|
||||
lambda {|message|
|
||||
m=message.gsub(/ #{Regexp.escape(secret)}$/, ' ****')
|
||||
log(num, m)
|
||||
}
|
||||
end
|
||||
|
||||
# Authenticate a user based in a string of the form user:secret when using the
|
||||
# driver secret is protocol:token
|
||||
# @param [String] the id for this request, used by OpenNebula core
|
||||
@ -115,7 +125,8 @@ class AuthDriver < OpenNebulaDriver
|
||||
Shellwords.escape(p)
|
||||
end.join(' '))
|
||||
|
||||
rc = LocalCommand.run(command, log_method(request_id))
|
||||
rc = LocalCommand.run(command,
|
||||
log_method_no_password(request_id, secret))
|
||||
|
||||
result , info = get_info_from_execution(rc)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user