Compare commits

..

8 Commits

Author SHA1 Message Date
openeuler-ci-bot 10c3caf88d !50 [sync] PR-49: Fix the CVE-2021-36690.
From: @openeuler-sync-bot
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-12-02 09:31:54 +00:00
wbq_sky 1c3ff49bdc fix the CVE-2021-36690
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
(cherry picked from commit 281ace3ce4)
2021-11-30 15:10:24 +08:00
openeuler-ci-bot e9c98a3a01 !48 Update the sqlite to 3.36
From: @wbq_sky
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-11-30 03:25:11 +00:00
wbq_sky a37dc54997 update the sqlite to 3.36
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
2021-11-25 15:59:33 +08:00
openeuler-ci-bot 3bd1f68830 !44 [sync] PR-39: Fix a problem caused by using an SQL variable in an over clause within a trigger.
From: @openeuler-sync-bot
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-09-27 03:58:50 +00:00
wbq_sky 77544d0ad8 fix the null reference in the over clause within trigger
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
(cherry picked from commit b5acf1da61)
2021-09-27 08:58:28 +08:00
openeuler-ci-bot 7585329627 !42 [sync] PR-38: fix the problem of the infinite loop in trim function.
From: @openeuler-sync-bot
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-09-27 00:43:11 +00:00
wbq_sky d043bf5376 fix the infinite loop in the trim function while the pattern is well formed.
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
(cherry picked from commit d81186e427)
2021-09-26 17:05:30 +08:00
12 changed files with 180 additions and 129 deletions
-2
View File
@@ -1,2 +0,0 @@
*.zip filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
-2
View File
@@ -1,2 +0,0 @@
[lfs]
url = https://artlfs.openeuler.openatom.cn/src-openEuler/sqlite
+24
View File
@@ -0,0 +1,24 @@
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"
@@ -0,0 +1,66 @@
From defded46ea50037500590122d847ba6a7cb96110 Mon Sep 17 00:00:00 2001
From: eulerstorage <eulerstoragemt@huawei.com>
Date: Sat, 11 Jan 2020 11:33:54 +0800
Subject: [PATCH] remove fail testcase in no free fd situation
Remove testcase 1.1.1, 1.1.2 and 1.1.3, since it can not success in
some situation if there is no enough fd resource.
---
test/oserror.test | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/test/oserror.test b/test/oserror.test
index a51301c..d46218f 100644
--- a/test/oserror.test
+++ b/test/oserror.test
@@ -40,47 +40,6 @@ proc do_re_test {tn script expression} {
}
-#--------------------------------------------------------------------------
-# Tests oserror-1.* test failures in the open() system call.
-#
-
-# Test a failure in open() due to too many files.
-#
-# The xOpen() method of the unix VFS calls getcwd() as well as open().
-# Although this does not appear to be documented in the man page, on OSX
-# 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]} {
- unset -nocomplain rc
- unset -nocomplain nOpen
- set nOpen 20000
- do_test 1.1.1 {
- set ::log [list]
- set ::rc [catch {
- for {set i 0} {$i < $::nOpen} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
- } msg]
- if {$::rc==0} {
- # Some system (ex: Debian) are able to create 20000+ file descriptiors
- # such systems will not fail here
- set x ok
- } elseif {$::rc==1 && $msg=="unable to open database file"} {
- set x ok
- } else {
- set x [list $::rc $msg]
- }
- } {ok}
- do_test 1.1.2 {
- catch { for {set i 0} {$i < $::nOpen} {incr i} { dbh_$i close } }
- } $::rc
- if {$rc} {
- 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.
#
do_test 1.2.1 {
--
1.8.3.1
+44
View File
@@ -0,0 +1,44 @@
diff -rNu a/ext/expert/sqlite3expert.c b/ext/expert/sqlite3expert.c
--- a/ext/expert/sqlite3expert.c 2021-11-25 09:00:19.267831518 +0800
+++ b/ext/expert/sqlite3expert.c 2021-11-25 09:07:38.551969861 +0800
@@ -690,11 +690,13 @@
rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_xinfo=%Q", zTab);
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
const char *zCol = (const char*)sqlite3_column_text(p1, 1);
+ const char *zColSeq = 0;
nByte += 1 + STRLEN(zCol);
rc = sqlite3_table_column_metadata(
- db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
+ db, "main", zTab, zCol, 0, &zColSeq, 0, 0, 0
);
- nByte += 1 + STRLEN(zCol);
+ if( zColSeq==0 ) zColSeq = "binary";
+ nByte += 1 + STRLEN(zColSeq);
nCol++;
nPk += (sqlite3_column_int(p1, 5)>0);
}
@@ -714,6 +716,7 @@
nCol = 0;
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
const char *zCol = (const char*)sqlite3_column_text(p1, 1);
+ const char *zColSeq = 0;
int nCopy = STRLEN(zCol) + 1;
pNew->aCol[nCol].zName = pCsr;
pNew->aCol[nCol].iPk = (sqlite3_column_int(p1, 5)==1 && nPk==1);
@@ -721,12 +724,13 @@
pCsr += nCopy;
rc = sqlite3_table_column_metadata(
- db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
+ db, "main", zTab, zCol, 0, &zColSeq, 0, 0, 0
);
if( rc==SQLITE_OK ){
- nCopy = STRLEN(zCol) + 1;
+ if( zColSeq==0 ) zColSeq = "binary";
+ nCopy = STRLEN(zColSeq) + 1;
pNew->aCol[nCol].zColl = pCsr;
- memcpy(pCsr, zCol, nCopy);
+ memcpy(pCsr, zColSeq, nCopy);
pCsr += nCopy;
}
-11
View File
@@ -1,11 +0,0 @@
--- a/tool/buildtclext.tcl 2024-11-18 14:01:05.040080030 +0800
+++ b/tool/buildtclext.tcl 2024-11-18 14:01:27.998394871 +0800
@@ -300,7 +300,7 @@
# Generate and execute the command with which to do the compilation.
#
- set cmd "$CMD -DUSE_TCL_STUBS tclsqlite3.c -o $OUT $LIBS"
+ set cmd "$CMD -DUSE_TCL_STUBS tclsqlite3.c -o $OUT $LIBS -lm"
puts $cmd
file delete -force $OUT
catch {exec {*}$cmd} errmsg
Binary file not shown.
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bdbd4e47d52c64c7acc332d1294aa67ad6251ef370abeb0b086ee0cbec91186d
size 11390337
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:119862654b36e252ac5f8add2b3d41ba03f4f387b48eb024956c36ea91012d3f
size 14393097
+46 -108
View File
@@ -1,30 +1,36 @@
%bcond_without check
%global extver 3360000
%global tcl_version 8.6
%global tcl_sitearch %{_libdir}/tcl%{tcl_version}
Name: sqlite
Version: 3.50.3
%global extver %(echo %{version} |awk -F. '{printf "%d%02d%02d00", $1,$2,$3}')
Release: 1
Version: 3.36.0
Release: 2
Summary: Embeded SQL database
License: Public Domain
URL: https://www.sqlite.org/
URL: http://www.sqlite.org/
Source0: https://www.sqlite.org/2025/sqlite-src-%{extver}.zip
Source1: https://www.sqlite.org/2025/sqlite-doc-%{extver}.zip
Patch0: sqlite-3.48.0-buildtclext.patch
Source0: https://www.sqlite.org/2021/sqlite-src-%{extver}.zip
Source1: http://www.sqlite.org/2021/sqlite-doc-%{extver}.zip
Source2: https://www.sqlite.org/2021/sqlite-autoconf-%{extver}.tar.gz
BuildRequires: gcc tcl tcl-devel
Patch1: 0001-sqlite-no-malloc-usable-size.patch
Patch2: 0002-remove-fail-testcase-in-no-free-fd-situation.patch
Patch3: 0003-CVE-2021-36690.patch
BuildRequires: gcc autoconf tcl tcl-devel
BuildRequires: ncurses-devel readline-devel glibc-devel
BuildRequires: chrpath
BuildRequires: rpm_macro(tcl_sitearch)
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < %{version}-%{release}
Provides: lemon = %{version}-%{release}
Obsoletes: lemon < %{version}-%{release}
Provides: %{name}-analyzer = %{version}-%{release}
Obsoletes: %{name}-analyzer < %{version}-%{release}
Provides: %{name}-tcl = %{version}-%{release}
Obsoletes: %{name}-tcl < %{version}-%{release}
Provides: %{name}-libs
Obsoletes: %{name}-libs
Provides: lemon
Obsoletes: lemon
Provides: %{name}-analyzer
Obsoletes: %{name}-analyzer
Provides: %{name}-tcl
Obsoletes: %{name}-tcl
%description
SQLite is a C-language library that implements a small, fast, self-contained,
@@ -36,6 +42,7 @@ use every day.It also include lemon and sqlite3_analyzer and tcl tools.
%package devel
Summary: Including header files and library for the developing of sqlite
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
This contains dynamic libraries and header files for the developing of sqlite.
@@ -43,8 +50,8 @@ This contains dynamic libraries and header files for the developing of sqlite.
%package help
Summary: Man file and documentation for sqlite
BuildArch: noarch
Provides: %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc < %{version}-%{release}
Provides: %{name}-doc
Obsoletes: %{name}-doc
%description help
This contains man files and HTML files for the using of sqlite.
@@ -53,10 +60,14 @@ 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}
%autopatch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
rm -f %{name}-doc-%{extver}/sqlite.css~ || :
autoconf
%build
export CFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 \
@@ -64,29 +75,30 @@ export CFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_JSON1=1 \
-Wall -fno-strict-aliasing"
export CC=%{__cc}
%configure --fts5 \
%configure --enable-fts5 \
--enable-threadsafe \
--enable-threads-override-locks \
--enable-load-extension \
--disable-static \
--soname=legacy \
TCLLIBDIR=%{tcl_sitearch}/sqlite3
# rpath removal
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
%make_build sqlite3_analyzer
%install
mkdir -p %{buildroot}/%{tcl_sitearch}/sqlite3
%make_install TCLLIBDIR=%{tcl_sitearch}/sqlite3
%delete_la
make DESTDIR=${RPM_BUILD_ROOT} install
install -D -m 755 lemon %{buildroot}%{_bindir}/lemon
install -D -m 644 tool/lempar.c %{buildroot}%{_datadir}/lemon/lempar.c
install -D -m 644 sqlite3.1 %{buildroot}%{_mandir}/man1/sqlite3.1
install -D -m 755 sqlite3_analyzer %{buildroot}%{_bindir}/sqlite3_analyzer
chmod 755 %{buildroot}/%{tcl_sitearch}/sqlite3/*.so
chrpath --delete $RPM_BUILD_ROOT/%{tcl_sitearch}/sqlite3/*.so
%if %{with check}
%check
@@ -97,20 +109,19 @@ export MALLOC_CHECK_=3
%else
rm test/csv01.test
%endif
%ifarch loongarch64
rm -rf test/thread1.test
rm -rf test/thread2.test
%endif
%make_build test
make test
%endif # with check
%ldconfig_scriptlets
%files
%doc README.md
%{_bindir}/{sqlite3,lemon,sqlite3_analyzer}
%{_libdir}/*.so.*
%{_datadir}/lemon
%{tcl_sitearch}/sqlite3
%exclude %{_libdir}/*.{la,a}
%files devel
%{_includedir}/*.h
@@ -122,85 +133,12 @@ rm -rf test/thread2.test
%{_mandir}/man*/*
%changelog
* Thu Jul 17 2025 Funda Wang <fundawang@yeah.net> - 3.50.3-1
- update to 3.50.3
* Sun Jun 29 2025 Funda Wang <fundawang@yeah.net> - 3.50.2-1
- update to 3.50.2
* Sat Jun 07 2025 Funda Wang <fundawang@yeah.net> - 3.50.1-1
- update to 3.50.1
* Fri May 30 2025 Funda Wang <fundawang@yeah.net> - 3.50.0-1
- update to 3.50.0
* Wed May 07 2025 Funda Wang <fundawang@yeah.net> - 3.49.2-1
- update to 3.49.2
* Mon Mar 10 2025 Funda Wang <fundawang@yeah.net> - 3.49.1-2
- remove rpath for tcl binding
* Wed Feb 19 2025 Funda Wang <fundawang@yeah.net> - 3.49.1-1
- update to 3.49.1
* Thu Feb 06 2025 Funda Wang <fundawang@yeah.net> - 3.49.0-1
- update to 3.49.0
* Sun Jan 19 2025 Funda Wang <fundawang@yeah.net> - 3.48.0-2
- set legacy soname, otherwise it changes too much
(see `./configure --help`)
* Tue Jan 14 2025 Funda Wang <fundawang@yeah.net> - 3.48.0-1
- update to 3.48.0
* Sun Dec 08 2024 Funda Wang <fundawang@yeah.net> - 3.47.2-1
- update to 3.47.2
* Tue Nov 26 2024 Funda Wang <fundawang@yeah.net> - 3.47.1-1
- update to 3.47.1
* Tue Oct 22 2024 Funda Wang <fundawang@yeah.net> - 3.47.0-1
- update to 3.47.0
* Tue Aug 13 2024 Funda Wang <fundawang@yeah.net> - 3.46.1-1
- update to 3.46.1
* Tue Feb 27 2024 Zheng Zhenyu <zheng.zhenyu@outlook.com> - 3.42.0-1
- Bump version to fix CVE-2024-0232
* Wed Jan 3 2024 mazhao <mazhao12@huawei.com> - 3.37.2-7
- fix the CVE-2023-7104
* Mon Aug 7 2023 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-6
- fix the CVE-2023-36191
* Fri Jan 13 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 3.37.2-5
- remove fail testcase for loongarch
* Wed Dec 14 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-4
- fix the CVE-2022-46908
* Wed Sep 14 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-3
- fix build problem
* Mon Sep 5 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-2
- fix integer overflow on gigabyte string
* Mon Aug 29 2022 zhuwentao <zhuwentao5@huawei.com> - 3.37.2-1
- update to 3.37.2
* Tue Aug 16 2022 liusirui <liusirui@huawei.com> - 3.36.0-3
- fix the CVE-2022-35737.
* Sat Nov 27 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-2
* Fri Nov 27 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-2
- fix the CVE-2021-36690.
* Fri Nov 25 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-1
- update to 3.36.0.
* Fri Sep 26 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-4
- fix the uninitialized value used in pattern match.
* Fri Sep 3 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-3
- fix the null reference in the tigger statement.