Skip to content

Commit

Permalink
Fix "Cannot add platform specific connection property" log spam (#1791)
Browse files Browse the repository at this point in the history
Regression caused by #1546
  • Loading branch information
rdicroce committed Jan 25, 2023
1 parent 0f5aff7 commit 99b1c81
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public DatasourceLogin clone() {
@Override
public Object connectToDatasource(Accessor accessor, Session session) throws DatabaseException {

return getConnector().connect(prepareProperties(properties, session), session);
return getConnector().connect(prepareProperties(session), session);
}

/**
Expand Down Expand Up @@ -309,11 +309,11 @@ public static String getVersion() {
* SECURE:
* The password in the login properties is encrypted. Return a clone
* of the properties with the password decrypted.
* @param properties connection properties
* Also adds platform-specific properties needed for proper functioning.
* @param session current session used for logging
*/
private Properties prepareProperties(Properties properties, Session session) {
Properties result = properties;
private Properties prepareProperties(Session session) {
Properties result = (Properties) properties.clone();
Object passwordObject = result.get("password");
if (passwordObject != null) {
// Fix for bug # 2700529
Expand All @@ -329,7 +329,6 @@ private Properties prepareProperties(Properties properties, Session session) {
// a securable object or the setEncryptedPassword flag is not true,
// don't bother trying to decrypt.
if (getSecurableObjectHolder().hasSecurableObject() || isEncryptedPasswordSet) {
result = (Properties)properties.clone();
// Bug 4117441 - Secure programming practices, store password in char[]
// If isEncryptedPasswordSet is true, or we have a SecurableObject then we stored
// the password as a char[], and we need to convert it into a String for the
Expand Down

0 comments on commit 99b1c81

Please sign in to comment.