diff options
author | Westly Ward | 2020-10-01 10:30:07 -0600 |
---|---|---|
committer | Westly Ward | 2020-10-01 10:30:07 -0600 |
commit | 90c74508217e59d57accf0a3095cd0916f765d97 (patch) | |
tree | d3d920d7b7ac3b9304559f571f31e8f4a568c413 | |
download | aur-90c74508217e59d57accf0a3095cd0916f765d97.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | CVE-2017-10140-cwd-db_config.patch | 22 | ||||
-rw-r--r-- | PKGBUILD | 79 | ||||
-rw-r--r-- | addraspi4.patch | 13 | ||||
-rw-r--r-- | db-atomic.patch | 22 |
5 files changed, 161 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..8dfa44ae9442 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = db-4.8-raspi4-magi + pkgdesc = The Berkeley DB embedded database system 4.8 - This is meant only to be used as a dependency for magiwallet-magid-raspi4 + pkgver = 4.8.30 + pkgrel = 1 + url = http://www.oracle.com/technology/software/products/berkeley-db/index.html + arch = aarch64 + license = custom + depends = gcc-libs + options = !libtool + options = !makeflags + source = http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz + source = db-atomic.patch + source = CVE-2017-10140-cwd-db_config.patch + source = addraspi4.patch + md5sums = f80022099c5742cd179343556179aa8c + md5sums = d56cef85d0fc9432b54a32993d4c9f06 + md5sums = c2d29f72c20625c09f30e35af3c4f2ff + md5sums = 3cd79ed62a089b20b33e163146d5aabd + sha256sums = e0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a + sha256sums = 7ab718c5624b4724a585c91f4cfdcd3830cfaf0ce1e865a4a79b316ba35990c0 + sha256sums = 7dfea34368f4d3d5b81973f7b0dbb8a54cdd09effb09b2b28763b2470833a614 + sha256sums = c059d699a2202b8d321d053214f3d190cdfec174c589d1fee65fd7b7b73c2ec4 + +pkgname = db-4.8-raspi4-magi + diff --git a/CVE-2017-10140-cwd-db_config.patch b/CVE-2017-10140-cwd-db_config.patch new file mode 100644 index 000000000000..8024e3aaed9a --- /dev/null +++ b/CVE-2017-10140-cwd-db_config.patch @@ -0,0 +1,22 @@ +Description: CVE-2017-10140: Reads DB_CONFIG from the current working directory + Do not access DB_CONFIG when db_home is not set. +Origin: vendor, https://src.fedoraproject.org/rpms/libdb/raw/8047fa8580659fcae740c25e91b490539b8453eb/f/db-5.3.28-cwd-db_config.patch +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-10140 +Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1464032 +Bug-SuSE: https://bugzilla.novell.com/show_bug.cgi?id=1043886 +Forwarded: no +Author: Petr Kubat <pkubat@redhat.com> +Reviewed-by: Salvatore Bonaccorso <carnil@debian.org> +Last-Update: 2017-08-17 + +--- db-5.3.28/env/env_open.c.old 2017-06-26 10:32:11.011419981 +0200 ++++ db-5.3.28/env/env_open.c 2017-06-26 10:32:46.893721233 +0200 +@@ -473,7 +473,7 @@ + env->db_mode = mode == 0 ? DB_MODE_660 : mode; + + /* Read the DB_CONFIG file. */ +- if ((ret = __env_read_db_config(env)) != 0) ++ if (env->db_home != NULL && (ret = __env_read_db_config(env)) != 0) + return (ret); + + /* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f86ea726dc25 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,79 @@ +# Maintainer: Westly Ward <sonicrules1234 at gmail dot com> +# Contributor: Raansu <Gero3977@gmail.com> +# Contributor: Leslie P. Polzer <polzer@gnu.org> +pkgname=db-4.8-raspi4-magi +pkgver=4.8.30 +pkgrel=1 +pkgdesc="The Berkeley DB embedded database system 4.8 - This is meant only to be used as a dependency for magiwallet-magid-raspi4" +arch=('aarch64') +license=('custom') +url="http://www.oracle.com/technology/software/products/berkeley-db/index.html" +depends=('gcc-libs') +options=('!libtool' '!makeflags') +source=(http://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz + 'db-atomic.patch' + 'CVE-2017-10140-cwd-db_config.patch' + 'addraspi4.patch') +md5sums=('f80022099c5742cd179343556179aa8c' + 'd56cef85d0fc9432b54a32993d4c9f06' + 'c2d29f72c20625c09f30e35af3c4f2ff' + '3cd79ed62a089b20b33e163146d5aabd') + +sha256sums=('e0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a' + '7ab718c5624b4724a585c91f4cfdcd3830cfaf0ce1e865a4a79b316ba35990c0' + '7dfea34368f4d3d5b81973f7b0dbb8a54cdd09effb09b2b28763b2470833a614' + 'c059d699a2202b8d321d053214f3d190cdfec174c589d1fee65fd7b7b73c2ec4') + +prepare() { + cd "$srcdir/db-$pkgver/" + + chmod +w dbinc/atomic.h + patch -p1 < "$srcdir"/db-atomic.patch + + chmod +w env/env_open.c + patch -u -p1 < "$srcdir"/CVE-2017-10140-cwd-db_config.patch + + chmod +w dist/config.sub + patch -u -p1 < "$srcdir"/addraspi4.patch +} + +build() { + cd "$srcdir/db-$pkgver/" + + cd "build_unix" + ../dist/configure --prefix=/usr --enable-compat185 --enable-shared --disable-static --enable-cxx --build=raspi4 + make LIBSO_LIBS=-lpthread || return 1 +} + +package() { + cd "$srcdir/db-$pkgver/" + + cd "build_unix" + make prefix="$pkgdir/usr" includedir="$pkgdir/usr/include/db4.8" install + +# Remove documents to save space, these can be found online if needed. + rm -rf "$pkgdir/usr/docs" + +# Remove conflicting symlinks created by make, should never overwrite +# main libdb symlinks to current version. Programs that need or use +# db4.8 should be able to find it. + rm -f "$pkgdir/usr/lib/libdb.so" + rm -f "$pkgdir/usr/lib/libdb_cxx.so" + rm -f "$pkgdir/usr/lib/libdb-4.so" + rm -f "$pkgdir/usr/lib/libdb_cxx-4.so" + mkdir "$pkgdir/usr/newlib/" + chmod -R 755 "$pkgdir/usr/newlib" + mv "$pkgdir/usr/lib" "$pkgdir/usr/newlib/db-4.8" + mv "$pkgdir/usr/newlib" "$pkgdir/usr/lib" + +# Rename db4.8 bin files to not conflict with current db version +# installed. Programs that need or use db4.8 should be aware of this +# name change. + cd "$pkgdir/usr/bin" + for i in *; do + mv $i db4.8_${i/db_/} + done + ln -s "/usr/lib/db-4.8/libdb_cxx-4.8.so" "$pkgdir/usr/lib/libdb_cxx-4.8.so" +# Install license. + install -Dm644 "$srcdir/db-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/addraspi4.patch b/addraspi4.patch new file mode 100644 index 000000000000..48b45df53fd3 --- /dev/null +++ b/addraspi4.patch @@ -0,0 +1,13 @@ +--- db-4.8.30/dist/config.sub 2010-04-12 14:25:23.000000000 -0600 ++++ db-4.8.30.new/dist/config.sub 2020-09-30 11:33:22.746637496 -0600 +@@ -303,6 +303,10 @@ + ms1) + basic_machine=mt-unknown + ;; ++ raspi4) ++ basic_machine=aarch64-unknown ++ os=-linux ++ ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and diff --git a/db-atomic.patch b/db-atomic.patch new file mode 100644 index 000000000000..08bcf440e087 --- /dev/null +++ b/db-atomic.patch @@ -0,0 +1,22 @@ +diff --git a/dbinc/atomic.h b/dbinc/atomic.h +index 0034dcc..50b8b74 100644 +--- a/dbinc/atomic.h ++++ b/dbinc/atomic.h +@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val; + #define atomic_inc(env, p) __atomic_inc(p) + #define atomic_dec(env, p) __atomic_dec(p) + #define atomic_compare_exchange(env, p, o, n) \ +- __atomic_compare_exchange((p), (o), (n)) ++ __atomic_compare_exchange_db((p), (o), (n)) + static inline int __atomic_inc(db_atomic_t *p) + { + int temp; +@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p) + * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html + * which configure could be changed to use. + */ +-static inline int __atomic_compare_exchange( ++static inline int __atomic_compare_exchange_db( + db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) + { + atomic_value_t was; |