Refactoring DatabaseAuthorizer to use a CaseFoldingHash function
authordumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jan 2010 21:09:21 +0000 (21:09 +0000)
committerdumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jan 2010 21:09:21 +0000 (21:09 +0000)
for the set of whitelisted sqlite functions, and fixing some
indenting issues.

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=33612

* storage/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::allowFunction):
* storage/DatabaseAuthorizer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@53198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/storage/DatabaseAuthorizer.cpp
WebCore/storage/DatabaseAuthorizer.h

index 38bd156686c4fa26f88ee20782078f344b65ee14..c4db241ce99e7deb3d5763e35fb83c0203c568da 100644 (file)
@@ -1,3 +1,17 @@
+2010-01-13  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Refactoring DatabaseAuthorizer to use a CaseFoldingHash function
+        for the set of whitelisted sqlite functions, and fixing some
+        indenting issues.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33612
+
+        * storage/DatabaseAuthorizer.cpp:
+        (WebCore::DatabaseAuthorizer::allowFunction):
+        * storage/DatabaseAuthorizer.h:
+
 2010-01-13  Carol Szabo  <carol.szabo@nokia.com>
 
         Reviewed by Darin Adler.
index d0654804ecbb907fcd8c5ef601c31eebce3e3464..d87d4d95c1c6081cdeed20ea5567f512f5d0271e 100644 (file)
@@ -344,10 +344,10 @@ int DatabaseAuthorizer::allowDetach(const String&)
 
 int DatabaseAuthorizer::allowFunction(const String& functionName)
 {
-  if (m_securityEnabled && !m_whitelistedFunctions.contains(functionName.lower()))
-    return SQLAuthDeny;
+    if (m_securityEnabled && !m_whitelistedFunctions.contains(functionName))
+        return SQLAuthDeny;
 
-  return SQLAuthAllow;
+    return SQLAuthAllow;
 }
 
 void DatabaseAuthorizer::disable()
index 2171561b30b4d10dff1e3ee3635c26450f4f6e43..037409e2f9a6c967875f84a11a0f5d38b2363e30 100644 (file)
@@ -104,7 +104,7 @@ private:
     bool m_lastActionChangedDatabase : 1;
     bool m_readOnly : 1;
 
-    HashSet<String> m_whitelistedFunctions;
+    HashSet<String, CaseFoldingHash> m_whitelistedFunctions;
 };
 
 } // namespace WebCore