Allow creating/dropping virtual tables when the module is FTS2.
authordumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Feb 2010 22:51:43 +0000 (22:51 +0000)
committerdumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Feb 2010 22:51:43 +0000 (22:51 +0000)
Reviewed by Dimitri Glazkov.

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

* storage/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::createVTable):
(WebCore::DatabaseAuthorizer::dropVTable):

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

WebCore/ChangeLog
WebCore/storage/DatabaseAuthorizer.cpp

index 82e379fc9924979ee15a25bad49bd172a067005b..ae1a99a942bca2199dc45c6e665b117f3d2e54fc 100644 (file)
@@ -1,3 +1,15 @@
+2010-02-18  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Allow creating/dropping virtual tables when the module is FTS2.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34867
+
+        * storage/DatabaseAuthorizer.cpp:
+        (WebCore::DatabaseAuthorizer::createVTable):
+        (WebCore::DatabaseAuthorizer::dropVTable):
+
 2010-02-18  Peter Kasting  <pkasting@google.com>
 
         Not reviewed, Chromium build fix.
index d87d4d95c1c6081cdeed20ea5567f512f5d0271e..6b6b1470a8abf5ebb1067254f45313dde39adbc2 100644 (file)
@@ -263,21 +263,29 @@ int DatabaseAuthorizer::dropTempView(const String&)
     return (m_readOnly && m_securityEnabled ? SQLAuthDeny : SQLAuthAllow);
 }
 
-int DatabaseAuthorizer::createVTable(const String&, const String&)
+int DatabaseAuthorizer::createVTable(const String& tableName, const String& moduleName)
 {
     if (m_readOnly && m_securityEnabled)
         return SQLAuthDeny;
 
+    // fts2 is used in Chromium
+    if (moduleName != "fts2")
+        return SQLAuthDeny;
+
     m_lastActionChangedDatabase = true;
-    return m_securityEnabled ? SQLAuthDeny : SQLAuthAllow;
+    return denyBasedOnTableName(tableName);
 }
 
-int DatabaseAuthorizer::dropVTable(const String&, const String&)
+int DatabaseAuthorizer::dropVTable(const String& tableName, const String& moduleName)
 {
     if (m_readOnly && m_securityEnabled)
         return SQLAuthDeny;
 
-    return m_securityEnabled ? SQLAuthDeny : SQLAuthAllow;
+    // fts2 is used in Chromium
+    if (moduleName != "fts2")
+        return SQLAuthDeny;
+
+    return denyBasedOnTableName(tableName);
 }
 
 int DatabaseAuthorizer::allowDelete(const String& tableName)