Compare commits

..

No commits in common. "165753341b2edd118d1f4710796ee4764cc84526" and "6450d79cd8836fc34beca6d4ab30bba6c18371af" have entirely different histories.

5 changed files with 11 additions and 28382 deletions

View File

@ -1,55 +0,0 @@
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

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
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: 42
Release: 37
Summary: The Berkeley DB database library for C
License: BSD and LGPLv2 and Sleepycat
URL: https://www.oracle.com/database/berkeley-db/
@ -34,16 +34,13 @@ 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
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
Patch9000: bugfix-fix-deadlock-on-mempool-file-locks.patch
Patch9001: libdb-limit-cpu.patch
patch9002: libdb-cbd-race.patch
BuildRequires: gcc gcc-c++ perl-interpreter libtool tcl-devel >= 8.5.2-3
BuildRequires: java-1.8.0-openjdk-devel chrpath zlib-devel
BuildRequires: java-devel >= 1:1.6.0 chrpath zlib-devel
Conflicts: filesystem < 3
Provides: %{name}-utils = %{version}-%{release}
@ -117,15 +114,11 @@ popd
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%ifarch sw_64
%patch43 -p1
%endif
%patch44 -p1
%patch9000 -p1
%patch9001 -p1
%patch9002 -p1
pushd dist
./s_config
@ -218,21 +211,6 @@ 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

View File

@ -1,33 +0,0 @@
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