diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-12-17 12:00:46 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-12-17 12:16:23 +0100 |
commit | 9203ae338fdbcaf614be8436172e05a24fd7d754 (patch) | |
tree | 8d28b7127d3eac043e160f02bc7f944d2a3e8a99 /connectivity | |
parent | 64dc8acbf13eff6d52056a9464bba550651dce95 (diff) |
HSQLDB: quote usernames
Change-Id: I8384920bc55dafb2cc6581fe82f38d4e2659cc3d
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/hsqldb/HUser.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx index 297591eb5092..0dfcd2cefa30 100644 --- a/connectivity/source/drivers/hsqldb/HUser.cxx +++ b/connectivity/source/drivers/hsqldb/HUser.cxx @@ -229,7 +229,7 @@ void SAL_CALL OHSQLUser::grantPrivileges( const OUString& objName, sal_Int32 obj Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); OUString sGrant = "GRANT " + sPrivs + " ON " + ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation) + - " TO " + m_Name; + " TO " + ::dbtools::quoteName(xMeta->getIdentifierQuoteString(), m_Name); Reference<XStatement> xStmt = m_xConnection->createStatement(); if(xStmt.is()) @@ -255,7 +255,7 @@ void SAL_CALL OHSQLUser::revokePrivileges( const OUString& objName, sal_Int32 ob Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); OUString sGrant = "REVOKE " + sPrivs + " ON " + ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation) + - " FROM " + m_Name; + " FROM " + ::dbtools::quoteName(xMeta->getIdentifierQuoteString(), m_Name); Reference<XStatement> xStmt = m_xConnection->createStatement(); if(xStmt.is()) @@ -269,8 +269,12 @@ void SAL_CALL OHSQLUser::changePassword( const OUString& /*oldPassword*/, const { ::osl::MutexGuard aGuard(m_aMutex); checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed); + + Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); + OUString sAlterPwd = "SET PASSWORD FOR " + - m_Name + "@\"%\" = PASSWORD('" + newPassword + "')"; + ::dbtools::quoteName(xMeta->getIdentifierQuoteString(), m_Name) + + "@\"%\" = PASSWORD('" + newPassword + "')"; Reference<XStatement> xStmt = m_xConnection->createStatement(); |