Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
165753341b
!39 [sync] PR-38: Support build with clang
From: @openeuler-sync-bot 
Reviewed-by: @overweight, @xiezhipeng1 
Signed-off-by: @overweight, @xiezhipeng1
2024-03-27 03:02:46 +00:00
luofeng14
9673acc496 support clang build
(cherry picked from commit 05a23f9b0084d03958ed6ae170c5f1a0091066e0)
2024-03-27 10:45:27 +08:00
openeuler-ci-bot
23abbd91d4
!28 添加sw架构
From: @wuzx065891 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2022-10-20 06:54:24 +00:00
wzx
de26e86521 Add sw64 architecture
Signed-off-by: wzx <wuzx1226@qq.com>
2022-10-19 15:01:41 +08:00
openeuler-ci-bot
bcc4aa0442
!22 change Buildrequire for fix build failed
From: @ccdxx 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2022-08-31 05:51:45 +00:00
chendexi
04ebc6f5ab Change the Buildrequire from java-devel to java-1.8-openjdk-devel
modify buildrequire

modify release
2022-08-30 15:42:44 +08:00
openeuler-ci-bot
da039f66da
!14 add check for device number in __check_lock_fn
From: @panxh_purple 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-06-28 08:38:30 +00:00
panxiaohe
65c2dcbf8e add check for device number in __check_lock_fn 2022-06-28 14:09:14 +08:00
openeuler-ci-bot
2c67e03841
!13 fix a potential infinite loop
From: @kouwq 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2022-06-21 07:31:22 +00:00
Kou Wenqi
f035da9fa5 fix a potential infinite loop 2022-06-21 09:16:41 +08:00
5 changed files with 28382 additions and 11 deletions

View File

@ -0,0 +1,55 @@
From ad2bb7182132f6d15c207a8c0d37d24e241eb468 Mon Sep 17 00:00:00 2001
From: hanxinke <hanxinke@huawei.com>
Date: Fri, 11 Feb 2022 11:08:18 +0800
Subject: [PATCH] add check for device number in __check_lock_fn
When a file with the same inode as the inode of /var/lib/rpm/.rpm.lock
exists on another partition, package updates will also execute correctly
because of check for device.
---
src/os/os_flock.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/os/os_flock.c b/src/os/os_flock.c
index 03aa3df..482dffa 100644
--- a/src/os/os_flock.c
+++ b/src/os/os_flock.c
@@ -10,6 +10,8 @@
#include "db_int.h"
+#include <linux/kdev_t.h>
+
#if !defined(HAVE_FCNTL) || !defined(HAVE_FLOCK)
static int __os_filelocking_notsup __P((ENV *));
#endif
@@ -34,6 +36,7 @@ int __check_lock_fn(fn, pid)
int i, inode;
struct stat st;
pid_t lpid = 0;
+ int f_major, f_minor, l_major, l_minor;
if (!fn)
return -1;
@@ -59,10 +62,16 @@ int __check_lock_fn(fn, pid)
/* Check the inode */
else if (i == 5) {
inode = 0;
- sscanf(token, "%*02x:%*02x:%d", &inode);
+ sscanf(token, "%02x:%02x:%d", &l_major, &l_minor, &inode);
/* Not the inode we are looking for */
if (inode != st.st_ino)
continue;
+
+ f_major = MAJOR(st.st_dev);
+ f_minor = MINOR(st.st_dev);
+ if ((f_major != l_major) || (f_minor != l_minor))
+ continue;
+
/*
* We have the correct file.
* We are either looking for a specific process or we do not care at all.
--
2.23.0

28234
db-5.3.28-sw.patch Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
From 7fe098ae34b54d41ec9273c7ae51ee8e708c8193 Mon Sep 17 00:00:00 2001
From: Kou Wenqi <kouwenqi@kylinos.cn>
Date: Mon, 20 Jun 2022 17:31:32 +0800
Subject: [PATCH] fix a potential infinite loop
---
src/dbinc/shqueue.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/dbinc/shqueue.h b/src/dbinc/shqueue.h
index 5fdbf47..8f185b5 100644
--- a/src/dbinc/shqueue.h
+++ b/src/dbinc/shqueue.h
@@ -261,8 +261,8 @@ struct { \
#define SH_TAILQ_NEXTP(elm, field, type) \
((struct type *)((u_int8_t *)(elm) + (elm)->field.stqe_next))
-#define SH_TAILQ_NEXT(elm, field, type) \
- ((elm)->field.stqe_next == -1 ? NULL : \
+#define SH_TAILQ_NEXT(elm, field, type) \
+ (((elm)->field.stqe_next == -1 || (elm)->field.stqe_next == 0) ? NULL : \
((struct type *)((u_int8_t *)(elm) + (elm)->field.stqe_next)))
/*
--
2.23.0

View File

@ -1,6 +1,6 @@
Name: libdb
Version: 5.3.28
Release: 37
Release: 42
Summary: The Berkeley DB database library for C
License: BSD and LGPLv2 and Sleepycat
URL: https://www.oracle.com/database/berkeley-db/
@ -34,13 +34,16 @@ Patch35: checkpoint-opd-deadlock.patch
Patch36: db-5.3.28-atomic_compare_exchange.patch
Patch37: backport-CVE-2019-2708-Resolved-data-store-execution-which-led-to-partial-DoS.patch
Patch9000: bugfix-fix-deadlock-on-mempool-file-locks.patch
Patch9001: libdb-limit-cpu.patch
patch9002: libdb-cbd-race.patch
Patch38: bugfix-fix-deadlock-on-mempool-file-locks.patch
Patch39: libdb-limit-cpu.patch
patch40: libdb-cbd-race.patch
Patch41: fix-a-potential-infinite-loop.patch
Patch42: add-check-for-device-number-in-__check_lock_fn.patch
Patch43: db-5.3.28-sw.patch
patch44: support-clang-build.patch
BuildRequires: gcc gcc-c++ perl-interpreter libtool tcl-devel >= 8.5.2-3
BuildRequires: java-devel >= 1:1.6.0 chrpath zlib-devel
BuildRequires: java-1.8.0-openjdk-devel chrpath zlib-devel
Conflicts: filesystem < 3
Provides: %{name}-utils = %{version}-%{release}
@ -114,11 +117,15 @@ popd
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch9000 -p1
%patch9001 -p1
%patch9002 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%ifarch sw_64
%patch43 -p1
%endif
%patch44 -p1
pushd dist
./s_config
@ -211,6 +218,21 @@ mv man/* %{buildroot}%{_mandir}/man1/
%{_mandir}/man1
%changelog
* Fri Mar 22 2024 luofeng <luofeng13@huawei.com> - 5.3.28-42
- support clang build
* Wed Oct 19 2022 wuzx<wuzx1226@qq.com> - 5.3.28-41
- add sw64 patch
* Tue Aug 30 2022 chendexi <chendexi@kylinos.cn> - 5.3.28-40
- Change the Buildrequire from java-devel to java-1.8.0-openjdk-devel
* Tue Jun 28 2022 panxiaohe <panxh.life@foxmail.com> - 5.3.28-39
- add check for device number in __check_lock_fn
* Tue Jun 21 2022 Kou Wenqi <kouwenqi@kylinos.cn> - 5.3.28-38
- Fix a potential infinite loop
* Mon Apr 19 2021 wangchen <wangchen137@huawei.com> - 5.3.28-37
- Fix CVE-2019-2708

33
support-clang-build.patch Normal file
View File

@ -0,0 +1,33 @@
From ba70232521c53b4f32733ba023b82157e6de6cdd Mon Sep 17 00:00:00 2001
From: luofeng <luofeng13@huawei.com>
Date: Thu, 21 Mar 2024 21:00:42 +0800
Subject: [PATCH] support clang build
---
db.1.85/PORT/Makefile | 2 +-
db.1.85/PORT/linux/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/db.1.85/PORT/Makefile b/db.1.85/PORT/Makefile
index 383b259..fc7518e 100644
--- a/db.1.85/PORT/Makefile
+++ b/db.1.85/PORT/Makefile
@@ -99,4 +99,4 @@ memmove.o:
mktemp.o:
${CC} -c -O -I. -Iinclude clib/mktemp.c
snprintf.o:
- ${CC} -c -O -I. -Iinclude clib/snprintf.c
+ ${CC} -c $(CFLAGS) -O -I. -Iinclude clib/snprintf.c
diff --git a/db.1.85/PORT/linux/Makefile b/db.1.85/PORT/linux/Makefile
index 40b7c55..6a70e2c 100644
--- a/db.1.85/PORT/linux/Makefile
+++ b/db.1.85/PORT/linux/Makefile
@@ -98,4 +98,4 @@ memmove.o:
mktemp.o:
${CC} -c -O -I. -Iinclude clib/mktemp.c
snprintf.o:
- ${CC} -c -O -I. -Iinclude clib/snprintf.c
+ ${CC} -c $(CFLAGS) -O -I. -Iinclude clib/snprintf.c
--
2.19.1