From b29e9426c282fc9dbcda4976771e8bc6bb6fac74 Mon Sep 17 00:00:00 2001 From: eulerstorage Date: Wed, 8 Jan 2020 10:32:47 +0800 Subject: [PATCH] repackaged --- ....patch => 0000-sqlite-CVE-2018-20346.patch | 0 ...sqlite-3.7.7.1-stupid-openfiles-test.patch | 37 ----- ...-sqlite-3.12.2-no-malloc-usable-size.patch | 24 --- 0003-sqlite-3.8.0-percentile-test.patch | 15 -- 0004-sqlite-3.8.10.1-tcl-regress-tests.patch | 137 ------------------ 0005-sqlite-3.16-datetest-2.2c.patch | 14 -- 0006-sqlite-3.18.0-sync2-dirsync.patch | 90 ------------ sqlite.spec | 29 ++-- 8 files changed, 9 insertions(+), 337 deletions(-) rename 0007-sqlite-CVE-2018-20346.patch => 0000-sqlite-CVE-2018-20346.patch (100%) delete mode 100644 0001-sqlite-3.7.7.1-stupid-openfiles-test.patch delete mode 100644 0002-sqlite-3.12.2-no-malloc-usable-size.patch delete mode 100644 0003-sqlite-3.8.0-percentile-test.patch delete mode 100644 0004-sqlite-3.8.10.1-tcl-regress-tests.patch delete mode 100644 0005-sqlite-3.16-datetest-2.2c.patch delete mode 100644 0006-sqlite-3.18.0-sync2-dirsync.patch diff --git a/0007-sqlite-CVE-2018-20346.patch b/0000-sqlite-CVE-2018-20346.patch similarity index 100% rename from 0007-sqlite-CVE-2018-20346.patch rename to 0000-sqlite-CVE-2018-20346.patch diff --git a/0001-sqlite-3.7.7.1-stupid-openfiles-test.patch b/0001-sqlite-3.7.7.1-stupid-openfiles-test.patch deleted file mode 100644 index 101f0d4..0000000 --- a/0001-sqlite-3.7.7.1-stupid-openfiles-test.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- sqlite-src-3240000/test/oserror.test.old 2018-06-05 08:40:35.656122573 +0200 -+++ sqlite-src-3240000/test/oserror.test 2018-06-05 08:40:45.614935197 +0200 -@@ -51,20 +51,20 @@ - # a call to getcwd() may fail if there are no free file descriptors. So - # an error may be reported for either open() or getcwd() here. - # --if {![clang_sanitize_address]} { -- do_test 1.1.1 { -- set ::log [list] -- list [catch { -- for {set i 0} {$i < 20000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 } -- } msg] $msg -- } {1 {unable to open database file}} -- do_test 1.1.2 { -- catch { for {set i 0} {$i < 20000} {incr i} { dbh_$i close } } -- } {1} -- do_re_test 1.1.3 { -- lindex $::log 0 -- } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - } --} -+#if {![clang_sanitize_address]} { -+# do_test 1.1.1 { -+# set ::log [list] -+# list [catch { -+# for {set i 0} {$i < 20000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 } -+# } msg] $msg -+# } {1 {unable to open database file}} -+# do_test 1.1.2 { -+# catch { for {set i 0} {$i < 20000} {incr i} { dbh_$i close } } -+# } {1} -+# do_re_test 1.1.3 { -+# lindex $::log 0 -+# } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - } -+#} - - - # Test a failure in open() due to the path being a directory. diff --git a/0002-sqlite-3.12.2-no-malloc-usable-size.patch b/0002-sqlite-3.12.2-no-malloc-usable-size.patch deleted file mode 100644 index b983bd3..0000000 --- a/0002-sqlite-3.12.2-no-malloc-usable-size.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up sqlite-src-3120200/configure.ac.malloc_usable_size sqlite-src-3120200/configure.ac ---- sqlite-src-3120200/configure.ac.malloc_usable_size 2016-04-25 09:46:48.134690570 +0200 -+++ sqlite-src-3120200/configure.ac 2016-04-25 09:48:41.622637181 +0200 -@@ -108,7 +108,7 @@ AC_CHECK_HEADERS([sys/types.h stdlib.h s - ######### - # Figure out whether or not we have these functions - # --AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64]) -+AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s strchrnul usleep utime pread pread64 pwrite pwrite64]) - - ######### - # By default, we use the amalgamation (this may be changed below...) -diff -up sqlite-src-3120200/configure.malloc_usable_size sqlite-src-3120200/configure ---- sqlite-src-3120200/configure.malloc_usable_size 2016-04-25 09:47:12.594679063 +0200 -+++ sqlite-src-3120200/configure 2016-04-25 09:49:28.684615042 +0200 -@@ -10275,7 +10275,7 @@ done - ######### - # Figure out whether or not we have these functions - # --for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64 -+for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s strchrnul usleep utime pread pread64 pwrite pwrite64 - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/0003-sqlite-3.8.0-percentile-test.patch b/0003-sqlite-3.8.0-percentile-test.patch deleted file mode 100644 index f828fa5..0000000 --- a/0003-sqlite-3.8.0-percentile-test.patch +++ /dev/null @@ -1,15 +0,0 @@ -# On i686 arch the removed test fails with result 2749999.50004681 instead of expected -# 2749999.5. This patch is temporary workaround and should be dropped as soon as a valid -# fix is found. - -diff -up sqlite-src-3080002/test/percentile.test.broken sqlite-src-3080002/test/percentile.test ---- sqlite-src-3080002/test/percentile.test.broken 2013-09-16 13:19:53.406004041 +0200 -+++ sqlite-src-3080002/test/percentile.test 2013-09-16 13:20:00.079024945 +0200 -@@ -195,7 +195,6 @@ ifcapable vtab { - foreach {in out} { - 0 0.0 - 100 9999990.0 -- 50 2749999.5 - 10 99999.9 - } { - do_test percentile-2.1.$in { diff --git a/0004-sqlite-3.8.10.1-tcl-regress-tests.patch b/0004-sqlite-3.8.10.1-tcl-regress-tests.patch deleted file mode 100644 index bdeb6da..0000000 --- a/0004-sqlite-3.8.10.1-tcl-regress-tests.patch +++ /dev/null @@ -1,137 +0,0 @@ -This patch disables a test which caused failed assertion in tcl 8.6.3. -According to sqlite upstream[1], this should be fixed in tcl 8.6.5. - -[1] http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/2015-May/059518.html - -diff -up sqlite-src-3130000/test/shell1.test.orig sqlite-src-3130000/test/shell1.test ---- sqlite-src-3140100/test/shell1.test.orig 2016-08-12 02:17:02.000000000 +0200 -+++ sqlite-src-3140100/test/shell1.test 2016-08-15 15:00:59.869664051 +0200 -@@ -855,67 +855,67 @@ do_test shell1-4.6 { - - # Test using arbitrary byte data with the shell via standard input/output. - # --do_test shell1-5.0 { -- # -- # NOTE: Skip NUL byte because it appears to be incompatible with command -- # shell argument parsing. -- # -- for {set i 1} {$i < 256} {incr i} { -- # -- # NOTE: Due to how the Tcl [exec] command works (i.e. where it treats -- # command channels opened for it as textual ones), the carriage -- # return character (and on Windows, the end-of-file character) -- # cannot be used here. -- # -- if {$i==0x0D || ($tcl_platform(platform)=="windows" && $i==0x1A)} { -- continue -- } -- if {$i>=0xE0 && $tcl_platform(os)=="OpenBSD"} continue -- if {$i>=0xE0 && $i<=0xEF && $tcl_platform(os)=="Linux"} continue -- set hex [format %02X $i] -- set char [subst \\x$hex]; set oldChar $char -- set escapes [list] -- if {$tcl_platform(platform)=="windows"} { -- # -- # NOTE: On Windows, we need to escape all the whitespace characters, -- # the alarm (\a) character, and those with special meaning to -- # the SQLite shell itself. -- # -- set escapes [list \ -- \a \\a \b \\b \t \\t \n \\n \v \\v \f \\f \r \\r \ -- " " "\" \"" \" \\\" ' \"'\" \\ \\\\] -- } else { -- # -- # NOTE: On Unix, we need to escape most of the whitespace characters -- # and those with special meaning to the SQLite shell itself. -- # The alarm (\a), backspace (\b), and carriage-return (\r) -- # characters do not appear to require escaping on Unix. For -- # the alarm and backspace characters, this is probably due to -- # differences in the command shell. For the carriage-return, -- # it is probably due to differences in how Tcl handles command -- # channel end-of-line translations. -- # -- set escapes [list \ -- \t \\t \n \\n \v \\v \f \\f \ -- " " "\" \"" \" \\\" ' \"'\" \\ \\\\] -- } -- set char [string map $escapes $char] -- set x [catchcmdex test.db ".print $char\n"] -- set code [lindex $x 0] -- set res [lindex $x 1] -- if {$code ne "0"} { -- error "failed with error: $res" -- } -- if {$res ne "$oldChar\n"} { -- if {[llength $res] > 0} { -- set got [format %02X [scan $res %c]] -- } else { -- set got -- } -- error "failed with byte $hex mismatch, got $got" -- } -- } --} {} -+#do_test shell1-5.0 { -+# # -+# # NOTE: Skip NUL byte because it appears to be incompatible with command -+# # shell argument parsing. -+# # -+# for {set i 1} {$i < 256} {incr i} { -+# # -+# # NOTE: Due to how the Tcl [exec] command works (i.e. where it treats -+# # command channels opened for it as textual ones), the carriage -+# # return character (and on Windows, the end-of-file character) -+# # cannot be used here. -+# # -+# if {$i==0x0D || ($tcl_platform(platform)=="windows" && $i==0x1A)} { -+# continue -+# } -+# if {$i>=0xE0 && $tcl_platform(os)=="OpenBSD"} continue -+# if {$i>=0xE0 && $i<=0xEF && $tcl_platform(os)=="Linux"} continue -+# set hex [format %02X $i] -+# set char [subst \\x$hex]; set oldChar $char -+# set escapes [list] -+# if {$tcl_platform(platform)=="windows"} { -+# # -+# # NOTE: On Windows, we need to escape all the whitespace characters, -+# # the alarm (\a) character, and those with special meaning to -+# # the SQLite shell itself. -+# # -+# set escapes [list \ -+# \a \\a \b \\b \t \\t \n \\n \v \\v \f \\f \r \\r \ -+# " " "\" \"" \" \\\" ' \"'\" \\ \\\\] -+# } else { -+# # -+# # NOTE: On Unix, we need to escape most of the whitespace characters -+# # and those with special meaning to the SQLite shell itself. -+# # The alarm (\a), backspace (\b), and carriage-return (\r) -+# # characters do not appear to require escaping on Unix. For -+# # the alarm and backspace characters, this is probably due to -+# # differences in the command shell. For the carriage-return, -+# # it is probably due to differences in how Tcl handles command -+# # channel end-of-line translations. -+# # -+# set escapes [list \ -+# \t \\t \n \\n \v \\v \f \\f \ -+# " " "\" \"" \" \\\" ' \"'\" \\ \\\\] -+# } -+# set char [string map $escapes $char] -+# set x [catchcmdex test.db ".print $char\n"] -+# set code [lindex $x 0] -+# set res [lindex $x 1] -+# if {$code ne "0"} { -+# error "failed with error: $res" -+# } -+# if {$res ne "$oldChar\n"} { -+# if {[llength $res] > 0} { -+# set got [format %02X [scan $res %c]] -+# } else { -+# set got -+# } -+# error "failed with byte $hex mismatch, got $got" -+# } -+# } -+#} {} - - # These test cases do not work on MinGW - if 0 { diff --git a/0005-sqlite-3.16-datetest-2.2c.patch b/0005-sqlite-3.16-datetest-2.2c.patch deleted file mode 100644 index 63857db..0000000 --- a/0005-sqlite-3.16-datetest-2.2c.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- sqlite-src-3160100/test/date.test.orig 2017-01-04 14:48:46.113737093 +0100 -+++ sqlite-src-3160100/test/date.test 2017-01-04 14:49:11.144833563 +0100 -@@ -76,11 +76,6 @@ datetest 2.1c datetime(0,'unixepochx') N - datetest 2.1d datetime('2003-10-22','unixepoch') NULL - datetest 2.2 datetime(946684800,'unixepoch') {2000-01-01 00:00:00} - datetest 2.2b datetime('946684800','unixepoch') {2000-01-01 00:00:00} --for {set i 0} {$i<1000} {incr i} { -- set sql [format {strftime('%%H:%%M:%%f',1237962480.%03d,'unixepoch')} $i] -- set res [format {06:28:00.%03d} $i] -- datetest 2.2c-$i $sql $res --} - datetest 2.3 {date('2003-10-22','weekday 0')} 2003-10-26 - datetest 2.4 {date('2003-10-22','weekday 1')} 2003-10-27 - datetest 2.4a {date('2003-10-22','weekday 1')} 2003-10-27 diff --git a/0006-sqlite-3.18.0-sync2-dirsync.patch b/0006-sqlite-3.18.0-sync2-dirsync.patch deleted file mode 100644 index 0c7d0a5..0000000 --- a/0006-sqlite-3.18.0-sync2-dirsync.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- sqlite-src-3180000/test/sync2.test.sync2-dirsync 2017-03-30 21:26:42.000000000 +0200 -+++ sqlite-src-3180000/test/sync2.test 2017-04-03 13:16:14.422329691 +0200 -@@ -44,6 +44,15 @@ - uplevel [list do_test $tn [list execsql_sync $sql] [list {*}$res]] - } - -+# Wrapper over the expected sync count, takes DIRSYNC into consideration -+proc expected_sync_count {sync_count} { -+ ifcapable dirsync { -+ return $sync_count -+ } else { -+ return [ incr sync_count -1 ] -+ } -+} -+ - #----------------------------------------------------------------------- - # Tests for journal mode. - # -@@ -53,13 +62,13 @@ - INSERT INTO t1 VALUES(1, 2); - } - --do_execsql_sync_test 1.1 { INSERT INTO t1 VALUES(3, 4) } 4 -+do_execsql_sync_test 1.1 { INSERT INTO t1 VALUES(3, 4) } [ expected_sync_count 4 ] - - # synchronous=normal. So, 1 sync on the directory, 1 on the journal, 1 - # on the db file. 3 in total. - do_execsql_test 1.2.1 { PRAGMA main.synchronous = NORMAL } - do_execsql_test 1.2.2 { PRAGMA main.synchronous } 1 --do_execsql_sync_test 1.2.3 { INSERT INTO t1 VALUES(5, 6) } 3 -+do_execsql_sync_test 1.2.3 { INSERT INTO t1 VALUES(5, 6) } [ expected_sync_count 3 ] - - # synchronous=off. No syncs. - do_execsql_test 1.3.1 { PRAGMA main.synchronous = OFF } -@@ -70,7 +79,7 @@ - # 2 on the journal, 1 on the db file. 4 in total. - do_execsql_test 1.4.1 { PRAGMA main.synchronous = FULL } - do_execsql_test 1.4.2 { PRAGMA main.synchronous } 2 --do_execsql_sync_test 1.4.3 { INSERT INTO t1 VALUES(9, 10) } 4 -+do_execsql_sync_test 1.4.3 { INSERT INTO t1 VALUES(9, 10) } [ expected_sync_count 4 ] - - #----------------------------------------------------------------------- - # Tests for wal mode. -@@ -79,7 +88,7 @@ - - # sync=full, journal_mode=wal. One sync on the directory, two on the - # wal file. --do_execsql_sync_test 1.6 { INSERT INTO t1 VALUES(11, 12) } 3 -+do_execsql_sync_test 1.6 { INSERT INTO t1 VALUES(11, 12) } [ expected_sync_count 3 ] - - # One sync on the wal file. - do_execsql_sync_test 1.7 { INSERT INTO t1 VALUES(13, 14) } 1 -@@ -112,7 +121,7 @@ - - # Wal mode, sync=normal. The first transaction does one sync on directory, - # one on the wal file. The second does no syncs. -- do_execsql_sync_test 1.11.1 { INSERT INTO t1 VALUES(19, 20) } 2 -+ do_execsql_sync_test 1.11.1 { INSERT INTO t1 VALUES(19, 20) } [ expected_sync_count 2 ] - do_execsql_sync_test 1.11.2 { INSERT INTO t1 VALUES(21, 22) } 0 - do_execsql_test 1.11.3 { PRAGMA main.synchronous } 1 - -@@ -129,14 +138,14 @@ - # Delete mode, sync=full. The first transaction does one sync on - # directory, two on the journal file, one on the db. The second does - # the same. -- do_execsql_sync_test 1.15.1 { INSERT INTO t1 VALUES(26, 27) } 4 -- do_execsql_sync_test 1.15.2 { INSERT INTO t1 VALUES(28, 29) } 4 -+ do_execsql_sync_test 1.15.1 { INSERT INTO t1 VALUES(26, 27) } [ expected_sync_count 4 ] -+ do_execsql_sync_test 1.15.2 { INSERT INTO t1 VALUES(28, 29) } [ expected_sync_count 4 ] - do_execsql_test 1.15.3 { PRAGMA main.synchronous } 2 - - # Switch back to wal mode. - do_execsql_test 1.16 { PRAGMA journal_mode = wal } {wal} - -- do_execsql_sync_test 1.17.1 { INSERT INTO t1 VALUES(30, 31) } 2 -+ do_execsql_sync_test 1.17.1 { INSERT INTO t1 VALUES(30, 31) } [ expected_sync_count 2 ] - do_execsql_sync_test 1.17.2 { INSERT INTO t1 VALUES(32, 33) } 0 - do_execsql_test 1.17.3 { PRAGMA main.synchronous } 1 - -@@ -152,8 +161,8 @@ - # Close and reopen the db. Back to synchronous=normal. - db close - sqlite3 db test.db -- do_execsql_sync_test 1.20.1 { INSERT INTO t1 VALUES(38, 39) } 4 -- do_execsql_sync_test 1.20.2 { INSERT INTO t1 VALUES(40, 41) } 4 -+ do_execsql_sync_test 1.20.1 { INSERT INTO t1 VALUES(38, 39) } [ expected_sync_count 4 ] -+ do_execsql_sync_test 1.20.2 { INSERT INTO t1 VALUES(40, 41) } [ expected_sync_count 4 ] - do_execsql_test 1.20.3 { PRAGMA main.synchronous } 2 - } - diff --git a/sqlite.spec b/sqlite.spec index 79cc483..599d960 100644 --- a/sqlite.spec +++ b/sqlite.spec @@ -6,7 +6,7 @@ Name: sqlite Version: 3.24.0 -Release: 6 +Release: 7 Summary: Embeded SQL database License: Public Domain URL: http://www.sqlite.org/ @@ -15,14 +15,7 @@ Source0: http://www.sqlite.org/2018/sqlite-src-%{extver}.zip Source1: http://www.sqlite.org/2018/sqlite-doc-%{extver}.zip Source2: https://www.sqlite.org/2018/sqlite-autoconf-%{extver}.tar.gz -Patch0000: 0000-sqlite-3.6.23-lemon-system-template.patch -Patch0001: 0001-sqlite-3.7.7.1-stupid-openfiles-test.patch -Patch0002: 0002-sqlite-3.12.2-no-malloc-usable-size.patch -Patch0003: 0003-sqlite-3.8.0-percentile-test.patch -Patch0004: 0004-sqlite-3.8.10.1-tcl-regress-tests.patch -Patch0005: 0005-sqlite-3.16-datetest-2.2c.patch -Patch0006: 0006-sqlite-3.18.0-sync2-dirsync.patch -Patch0007: 0007-sqlite-CVE-2018-20346.patch +Patch0000: 0000-sqlite-CVE-2018-20346.patch Patch6000: 6000-Fix-the-sqlite3BeginTrans-calls-within-the-snapshot-.patch Patch6001: 6001-Change-a-comma-into-a-logically-equivalent-but-seman.patch @@ -115,17 +108,7 @@ This contains man files and HTML files for the using of sqlite. %prep #autosetup will fail because of 2 zip files %setup -q -a1 -n %{name}-src-%{extver} -%patch0000 -p1 -%patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 -%patch0004 -p1 -%ifarch %{ix86} -%patch0005 -p1 -%endif -%patch0006 -p1 -%patch0007 -p0 - +%patch0000 -p0 %patch6000 -p1 %patch6001 -p1 %patch6002 -p1 @@ -245,6 +228,12 @@ make test %{_mandir}/man*/* %changelog +* Wed Jan 8 2020 openEuler Buildteam - 3.24.0-7 +- Type:enhance +- ID:NA +- SUG:NA +- DESC:repackaged + * Fri Jan 3 2020 openEuler Buildteam - 3.24.0-6 - Type:cves - ID:CVE-2019-9936,CVE-2019-9937 -- Gitee