summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-23 04:17:45 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-23 04:17:45 +0000
commitda8df5546dc8fbccfa572000c855da51b60c5e55 (patch)
tree53af2117dc47d1f86cc9cd7bd80db7258eb67849 /third_party/sqlite
parent2907bd6938108dd247cf3fa4eee5a8b49c7a99fc (diff)
downloadchromium_src-da8df5546dc8fbccfa572000c855da51b60c5e55.zip
chromium_src-da8df5546dc8fbccfa572000c855da51b60c5e55.tar.gz
chromium_src-da8df5546dc8fbccfa572000c855da51b60c5e55.tar.bz2
Fix authorizer issue with fts3 in WebDatabase.
fts3 itself was authorized, but the most recent fts3 implementation calls PRAGMA page_size, and PRAGMA was not authorized. BUG=85522 TEST=See bug. Review URL: http://codereview.chromium.org/7230021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90163 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite')
-rw-r--r--third_party/sqlite/README.chromium3
-rw-r--r--third_party/sqlite/amalgamation/sqlite3.c3
-rw-r--r--third_party/sqlite/fts3_85522.patch21
-rw-r--r--third_party/sqlite/src/ext/fts3/fts3.c3
4 files changed, 30 insertions, 0 deletions
diff --git a/third_party/sqlite/README.chromium b/third_party/sqlite/README.chromium
index 714da32..a38ffda 100644
--- a/third_party/sqlite/README.chromium
+++ b/third_party/sqlite/README.chromium
@@ -63,6 +63,7 @@ preload-cache.patch
safe-tolower.patch
fts2.patch
fts3.patch
+fts3_85522.patch
icu-regexp.patch
icu-shell.patch
attach-integer.patch
@@ -77,6 +78,7 @@ patch -p0 < ../sqlite/misc.patch
patch -p0 < ../sqlite/preload-cache.patch
patch -p0 < ../sqlite/fts2.patch
patch -p0 < ../sqlite/fts3.patch
+patch -p0 < ../sqlite/fts3_85522.patch
patch -p0 < ../sqlite/icu-shell.patch
patch -p0 < ../sqlite/webdb.patch
patch -p0 < ../sqlite/test.patch
@@ -184,3 +186,4 @@ Changes from Chrome:
sqliteInt.h. In order to eliminate a symbol conflict with an Apple library
after amalgamation it was also necessary to rename fts3_porter.c's 'cType'
to 'vOrCType'.
+ - fts3_85522.patch allows fts3 to work if PRAGMA is not authorized.
diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c
index b1a6cc8..6213b43 100644
--- a/third_party/sqlite/amalgamation/sqlite3.c
+++ b/third_party/sqlite/amalgamation/sqlite3.c
@@ -111685,6 +111685,9 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){
sqlite3_step(pStmt);
p->nPgsz = sqlite3_column_int(pStmt, 0);
rc = sqlite3_finalize(pStmt);
+ }else if( rc==SQLITE_AUTH ){
+ p->nPgsz = 1024;
+ rc = SQLITE_OK;
}
}
assert( p->nPgsz>0 || rc!=SQLITE_OK );
diff --git a/third_party/sqlite/fts3_85522.patch b/third_party/sqlite/fts3_85522.patch
new file mode 100644
index 0000000..8d7d181
--- /dev/null
+++ b/third_party/sqlite/fts3_85522.patch
@@ -0,0 +1,21 @@
+Fix http://crbug.com/85522
+
+WebDatabase uses an authorizer to prevent inappropriate access.
+fts3.c uses 'PRAGMA page_size' to tune the query optimizer, but PRAGMA
+is on the disallowed list. This patch adds a default return value for
+SQLITE_AUTH failures.
+
+diff --git src/ext/fts3/fts3.c src/ext/fts3/fts3.c
+index 8498cfa..dfa3891 100644
+--- src/ext/fts3/fts3.c
++++ src/ext/fts3/fts3.c
+@@ -630,6 +630,9 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){
+ sqlite3_step(pStmt);
+ p->nPgsz = sqlite3_column_int(pStmt, 0);
+ rc = sqlite3_finalize(pStmt);
++ }else if( rc==SQLITE_AUTH ){
++ p->nPgsz = 1024;
++ rc = SQLITE_OK;
+ }
+ }
+ assert( p->nPgsz>0 || rc!=SQLITE_OK );
diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext/fts3/fts3.c
index 8498cfa..d11572a 100644
--- a/third_party/sqlite/src/ext/fts3/fts3.c
+++ b/third_party/sqlite/src/ext/fts3/fts3.c
@@ -630,6 +630,9 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){
sqlite3_step(pStmt);
p->nPgsz = sqlite3_column_int(pStmt, 0);
rc = sqlite3_finalize(pStmt);
+ }else if( rc==SQLITE_AUTH ){
+ p->nPgsz = 1024;
+ rc = SQLITE_OK;
}
}
assert( p->nPgsz>0 || rc!=SQLITE_OK );