From 383ec3742d70d3f3c9d452adbd260eca8827ea9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Thu, 18 Feb 2016 14:01:43 +0100
Subject: Adjust to sqlite-3.11.0

---
 ...rl-tokenizer-only-if-DBD-SQLite-is-compil.patch | 57 ++++++++++++++++++++++
 ...TE_ENABLE_FTS3_TOKENIZER-environmental-va.patch | 34 +++++++++++++
 ...3_tokenizer-is-disabled-by-default-for-se.patch | 32 ++++++++++++
 perl-DBD-SQLite.spec                               | 14 +++++-
 4 files changed, 136 insertions(+), 1 deletion(-)
 create mode 100644 
DBD-SQLite-1.46-register-perl-tokenizer-only-if-DBD-SQLite-is-compil.patch
 create mode 100644 
DBD-SQLite-1.46-see-if-SQLITE_ENABLE_FTS3_TOKENIZER-environmental-va.patch
 create mode 100644 
DBD-SQLite-1.50-two-arg-fts3_tokenizer-is-disabled-by-default-for-se.patch

diff --git 
a/DBD-SQLite-1.46-register-perl-tokenizer-only-if-DBD-SQLite-is-compil.patch 
b/DBD-SQLite-1.46-register-perl-tokenizer-only-if-DBD-SQLite-is-compil.patch
new file mode 100644
index 0000000..127aa51
--- /dev/null
+++ b/DBD-SQLite-1.46-register-perl-tokenizer-only-if-DBD-SQLite-is-compil.patch
@@ -0,0 +1,57 @@
+From 93ac66c8f14f3029a152b3866ffc2c6272b45041 Mon Sep 17 00:00:00 2001
+From: Kenichi Ishigaki <ishig...@cpan.org>
+Date: Tue, 16 Feb 2016 12:55:38 +0900
+Subject: [PATCH] register perl tokenizer only if DBD::SQLite is compiled with
+ -DSQLITE_ENABLE_FTS3_TOKENIZER
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Petr Písař: Ported to 1.46.
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ SQLite.xs | 4 ++++
+ dbdimp.c  | 3 ++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/SQLite.xs b/SQLite.xs
+index 6bbc5a9..82fc6c3 100644
+--- a/SQLite.xs
++++ b/SQLite.xs
+@@ -267,7 +267,11 @@ register_fts3_perl_tokenizer(dbh)
+     ALIAS:
+         DBD::SQLite::db::sqlite_register_fts3_perl_tokenizer = 1
+     CODE:
++#if SQLITE_ENABLE_FTS3_TOKENIZER
+         RETVAL = sqlite_db_register_fts3_perl_tokenizer(aTHX_ dbh);
++#else
++        RETVAL = 0;
++#endif
+     OUTPUT:
+         RETVAL
+ 
+diff --git a/dbdimp.c b/dbdimp.c
+index 8288b70..8fa4a3d 100644
+--- a/dbdimp.c
++++ b/dbdimp.c
+@@ -2532,6 +2532,7 @@ sqlite_db_backup_to_file(pTHX_ SV *dbh, char *filename)
+ #endif
+ }
+ 
++#if SQLITE_VERSION_NUMBER < 3011000 || SQLITE_ENABLE_FTS3_TOKENIZER
+ typedef struct perl_tokenizer {
+     sqlite3_tokenizer base;
+     SV *coderef;                 /* the perl tokenizer is a coderef that takes
+@@ -2820,7 +2821,7 @@ int sqlite_db_register_fts3_perl_tokenizer(pTHX_ SV *dbh)
+ 
+     return sqlite3_finalize(pStmt);
+ }
+-
++#endif
+ 
+ 
+ /*********************************************************************** 
+-- 
+2.5.5
+
diff --git 
a/DBD-SQLite-1.46-see-if-SQLITE_ENABLE_FTS3_TOKENIZER-environmental-va.patch 
b/DBD-SQLite-1.46-see-if-SQLITE_ENABLE_FTS3_TOKENIZER-environmental-va.patch
new file mode 100644
index 0000000..8ad1f25
--- /dev/null
+++ b/DBD-SQLite-1.46-see-if-SQLITE_ENABLE_FTS3_TOKENIZER-environmental-va.patch
@@ -0,0 +1,34 @@
+From ecd01348e17d985a7dd3ea65f03c0e794af5c70a Mon Sep 17 00:00:00 2001
+From: Kenichi Ishigaki <ishig...@cpan.org>
+Date: Tue, 16 Feb 2016 13:06:51 +0900
+Subject: [PATCH] see if SQLITE_ENABLE_FTS3_TOKENIZER environmental variable is
+ set, for those who do need perl tokenizer
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Petr Písař: Ported to 1.46.
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ Makefile.PL | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index c8c3d58..92896e4 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -224,6 +224,10 @@ my @CC_DEFINE = (
+       '-DSQLITE_ENABLE_STAT4',            # for sqlite >= 3.8.3.1
+       '-DNDEBUG=1',
+ );
++# for upstream security concern, this should be set only if requested
++if ($ENV{SQLITE_ENABLE_FTS3_TOKENIZER}) {
++      push @CC_DEFINE, '-DSQLITE_ENABLE_FTS3_TOKENIZER'; # for sqlite >= 
3.11.0
++}
+ if ( $^O eq 'cygwin') {
+       push @CC_DEFINE, '-DSQLITE_TEMP_STORE=2';
+ }
+-- 
+2.5.5
+
diff --git 
a/DBD-SQLite-1.50-two-arg-fts3_tokenizer-is-disabled-by-default-for-se.patch 
b/DBD-SQLite-1.50-two-arg-fts3_tokenizer-is-disabled-by-default-for-se.patch
new file mode 100644
index 0000000..1023f3b
--- /dev/null
+++ b/DBD-SQLite-1.50-two-arg-fts3_tokenizer-is-disabled-by-default-for-se.patch
@@ -0,0 +1,32 @@
+From abed684c431beab32d20da69e344bf3075102a1e Mon Sep 17 00:00:00 2001
+From: Kenichi Ishigaki <ishig...@cpan.org>
+Date: Tue, 16 Feb 2016 11:55:27 +0900
+Subject: [PATCH] two-arg fts3_tokenizer() is disabled by default for security
+ concerns as of SQLite 3.11.0, unless DBD::SQLite is compiled with
+ -DSQLITE_ENABLE_FTS3_TOKENIZER
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ t/43_fts3.t | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/t/43_fts3.t b/t/43_fts3.t
+index 7af6c2e..64910ee 100644
+--- a/t/43_fts3.t
++++ b/t/43_fts3.t
+@@ -33,6 +33,9 @@ BEGIN {
+       if (!grep /ENABLE_FTS3/, DBD::SQLite::compile_options()) {
+               plan skip_all => 'FTS3 is disabled for this DBD::SQLite';
+       }
++      if ($DBD::SQLite::sqlite_version_number >= 3011000 and !grep 
/ENABLE_FTS3_TOKENIZER/, DBD::SQLite::compile_options()) {
++              plan skip_all => 'FTS3 tokenizer is disabled for this 
DBD::SQLite';
++      }
+ }
+ use Test::NoWarnings;
+ 
+-- 
+2.5.0
+
diff --git a/perl-DBD-SQLite.spec b/perl-DBD-SQLite.spec
index 7f81c8a..03a2915 100644
--- a/perl-DBD-SQLite.spec
+++ b/perl-DBD-SQLite.spec
@@ -1,6 +1,6 @@
 Name:           perl-DBD-SQLite
 Version:        1.46
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        SQLite DBI Driver
 Group:          Development/Libraries
 License:        (GPL+ or Artistic) and Public Domain
@@ -22,6 +22,12 @@ Patch4:         
DBD-SQLite-1.46-added-a-note-on-strlike-and-strglob.patch
 # Adapt to sqlite-3.10.0, bug #1298628, in upstream 1.49_05
 # Add DBD::SQLite::strlike tests
 Patch5:         DBD-SQLite-1.46-added-a-test-for-strlike.patch
+# Adjust to sqlite-3.11.0, bug #1309675, in upstream after 1.50
+Patch6:         
DBD-SQLite-1.50-two-arg-fts3_tokenizer-is-disabled-by-default-for-se.patch
+# Adjust to sqlite-3.11.0, bug #1309675, in upstream after 1.50
+Patch7:         
DBD-SQLite-1.46-register-perl-tokenizer-only-if-DBD-SQLite-is-compil.patch
+# Adjust to sqlite-3.11.0, bug #1309675, in upstream after 1.50
+Patch8:         
DBD-SQLite-1.46-see-if-SQLITE_ENABLE_FTS3_TOKENIZER-environmental-va.patch
 # if sqlite >= 3.1.3 then
 #   perl-DBD-SQLite uses the external library
 # else
@@ -74,6 +80,9 @@ libraries.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
 # Remove bundled sqlite libraries (BZ#1059154)
 # System libraries will be used
 rm sqlite*
@@ -99,6 +108,9 @@ make test
 %{_mandir}/man3/*.3pm*
 
 %changelog
+* Wed Mar 23 2016 Petr Pisar <ppi...@redhat.com> - 1.46-4
+- Adjust to sqlite-3.11.0 (bug #1309675)
+
 * Fri Jan 15 2016 Petr Pisar <ppi...@redhat.com> - 1.46-3
 - Adapt to sqlite-3.10.0 by adding DBD::SQLite::strlike() (bug #1298628)
 
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl-DBD-SQLite.git/commit/?h=f22&id=383ec3742d70d3f3c9d452adbd260eca8827ea9a
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org

Reply via email to