Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: third_party/sqlite/patches/0007-fts3-Disable-fts3_tokenizer-and-fts4.patch

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 From c18bc2961fbb401a1941e736d81bd048c3b82e88 Mon Sep 17 00:00:00 2001 1 From 9283044fa483fceefcb077d7b682d570e0d099ee Mon Sep 17 00:00:00 2001
2 From: Scott Hess <shess@chromium.org> 2 From: Scott Hess <shess@chromium.org>
3 Date: Tue, 16 Dec 2014 13:02:27 -0800 3 Date: Tue, 16 Dec 2014 13:02:27 -0800
4 Subject: [PATCH 08/16] [fts3] Disable fts3_tokenizer and fts4. 4 Subject: [PATCH 07/10] [fts3] Disable fts3_tokenizer and fts4.
5 5
6 fts3_tokenizer allows a SQLite user to specify a pointer to call as a 6 fts3_tokenizer allows a SQLite user to specify a pointer to call as a
7 function, which has obvious sercurity implications. Disable fts4 until 7 function, which has obvious sercurity implications. Disable fts4 until
8 someone explicitly decides to own support for it. Disable fts3tokenize 8 someone explicitly decides to own support for it. Disable fts3tokenize
9 virtual table until someone explicitly decides to own support for it. 9 virtual table until someone explicitly decides to own support for it.
10 10
11 No original review URL because this was part of the initial Chromium commit. 11 No original review URL because this was part of the initial Chromium commit.
12 --- 12 ---
13 third_party/sqlite/src/ext/fts3/fts3.c | 9 +++++++++ 13 third_party/sqlite/src/ext/fts3/fts3.c | 9 +++++++++
14 1 file changed, 9 insertions(+) 14 1 file changed, 9 insertions(+)
15 15
16 diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext /fts3/fts3.c 16 diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext /fts3/fts3.c
17 index 2b93c62..dbd2835 100644 17 index 748faef..4f2ebb8 100644
18 --- a/third_party/sqlite/src/ext/fts3/fts3.c 18 --- a/third_party/sqlite/src/ext/fts3/fts3.c
19 +++ b/third_party/sqlite/src/ext/fts3/fts3.c 19 +++ b/third_party/sqlite/src/ext/fts3/fts3.c
20 @@ -287,6 +287,7 @@ 20 @@ -287,6 +287,7 @@
21 ** query logic likewise merges doclists so that newer data knocks out 21 ** query logic likewise merges doclists so that newer data knocks out
22 ** older data. 22 ** older data.
23 */ 23 */
24 +#define CHROMIUM_FTS3_CHANGES 1 24 +#define CHROMIUM_FTS3_CHANGES 1
25 25
26 #include "fts3Int.h" 26 #include "fts3Int.h"
27 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) 27 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
28 @@ -3828,7 +3829,11 @@ int sqlite3Fts3Init(sqlite3 *db){ 28 @@ -3933,7 +3934,11 @@ int sqlite3Fts3Init(sqlite3 *db){
29 ** module with sqlite. 29 ** module with sqlite.
30 */ 30 */
31 if( SQLITE_OK==rc 31 if( SQLITE_OK==rc
32 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST 32 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST
33 + /* fts3_tokenizer() disabled for security reasons. */ 33 + /* fts3_tokenizer() disabled for security reasons. */
34 +#else 34 +#else
35 && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer")) 35 && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer"))
36 +#endif 36 +#endif
37 && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) 37 && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1))
38 && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) 38 && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1))
39 && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) 39 && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1))
40 @@ -3838,6 +3843,9 @@ int sqlite3Fts3Init(sqlite3 *db){ 40 @@ -3943,6 +3948,9 @@ int sqlite3Fts3Init(sqlite3 *db){
41 rc = sqlite3_create_module_v2( 41 rc = sqlite3_create_module_v2(
42 db, "fts3", &fts3Module, (void *)pHash, hashDestroy 42 db, "fts3", &fts3Module, (void *)pHash, hashDestroy
43 ); 43 );
44 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST 44 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST
45 + /* Disable fts4 and tokenizer vtab pending review. */ 45 + /* Disable fts4 and tokenizer vtab pending review. */
46 +#else 46 +#else
47 if( rc==SQLITE_OK ){ 47 if( rc==SQLITE_OK ){
48 rc = sqlite3_create_module_v2( 48 rc = sqlite3_create_module_v2(
49 db, "fts4", &fts3Module, (void *)pHash, 0 49 db, "fts4", &fts3Module, (void *)pHash, 0
50 @@ -3846,6 +3854,7 @@ int sqlite3Fts3Init(sqlite3 *db){ 50 @@ -3951,6 +3959,7 @@ int sqlite3Fts3Init(sqlite3 *db){
51 if( rc==SQLITE_OK ){ 51 if( rc==SQLITE_OK ){
52 rc = sqlite3Fts3InitTok(db, (void *)pHash); 52 rc = sqlite3Fts3InitTok(db, (void *)pHash);
53 } 53 }
54 +#endif 54 +#endif
55 return rc; 55 return rc;
56 } 56 }
57 57
58 -- 58 --
59 2.2.1 59 2.7.0
60 60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698