From d0ea1f5db08b117422386251fe719f320f022ae1 Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Sat, 21 Jan 2023 14:53:59 +0300 Subject: [PATCH] redis: update to 7.0.8. The primary reason for updating this package is due to the following CVEs being found and fixed: * CVE-2022-35977 (Integer overflow in the Redis SETRANGE and SORT/SORT_RO commands can drive Redis to OOM panic) * CVE-2023-22458 (Integer overflow in the Redis HRANDFIELD and ZRANDMEMBER commands can lead to denial-of-service) The rest is as follows: * jemalloc-devel and libatomic-devel now are included conditionally. * antirez/redis has been moved to redis/redis (antirez stepped down in 2020 and handed over his work to his colleagues). * do_check can be executed by setting make_check_target to "test". * V=1 is retained in make_build_args; MALLOC is defined outside the removed do_build function. * the "-ldl" flag in use-system-jemalloc.patch is no longer necessary since it is already defined in src/Makefile; see redis/redis@b7b9aa6d9bbed5a292f3e939bf0c5906bdf965ca * do_configure is renamed to post_patch as its contents fit the latter's purpose. --- .../redis/patches/use-system-jemalloc.patch | 2 +- srcpkgs/redis/template | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/srcpkgs/redis/patches/use-system-jemalloc.patch b/srcpkgs/redis/patches/use-system-jemalloc.patch index c32bcdd09255..e3b8e555b9fc 100644 --- a/srcpkgs/redis/patches/use-system-jemalloc.patch +++ b/srcpkgs/redis/patches/use-system-jemalloc.patch @@ -8,7 +8,7 @@ - FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include - FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) + FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -+ FINAL_LIBS+= -ljemalloc -ldl ++ FINAL_LIBS+= -ljemalloc endif REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) diff --git a/srcpkgs/redis/template b/srcpkgs/redis/template index 110484cdb527..ff3be6c070ca 100644 --- a/srcpkgs/redis/template +++ b/srcpkgs/redis/template @@ -1,16 +1,18 @@ # Template file for 'redis' pkgname=redis -version=7.0.5 +version=7.0.8 revision=1 -makedepends="jemalloc-devel libatomic-devel" +build_style=gnu-makefile +make_build_args="V=1" +make_check_target="test" checkdepends="pkg-config procps-ng tcl-devel which" short_desc="Advanced key-value store" maintainer="Enno Boland " license="BSD-3-Clause" homepage="https://redis.io" -changelog="https://raw.githubusercontent.com/antirez/redis/${version%.*}/00-RELEASENOTES" -distfiles="http://download.redis.io/releases/${pkgname}-${version}.tar.gz" -checksum=67054cc37b58c125df93bd78000261ec0ef4436a26b40f38262c780e56315cc3 +changelog="https://raw.githubusercontent.com/redis/redis/${version%.*}/00-RELEASENOTES" +distfiles="http://download.redis.io/releases/redis-${version}.tar.gz" +checksum=06a339e491306783dcf55b97f15a5dbcbdc01ccbde6dc23027c475cab735e914 system_accounts="redis" redis_homedir="/var/lib/redis" @@ -18,24 +20,22 @@ conf_files="/etc/redis/redis.conf" make_dirs="/var/lib/redis 0700 redis redis" -do_configure() { +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + make_build_args+=" MALLOC=libc" +else + makedepends+=" jemalloc-devel" + make_build_args+=" MALLOC=jemalloc" +fi + +post_patch() { vsed -i \ -e "s|^# bind 127.0.0.1|bind 127.0.0.1|" \ -e "s|^dir .*|dir ${redis_homedir}|" \ -e "s|^pidfile .*|pidfile /run/redis/redis.pid|" redis.conf - vsed -i -e "s|^FINAL_LIBS=.*|& -latomic|" src/Makefile -} - -do_build() { - case "$XBPS_TARGET_MACHINE" in - *-musl) _malloc="none";; - *) _malloc="jemalloc";; - esac - make CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" V=1 MALLOC=${_malloc} ${makejobs} -} -do_check() { - make test + if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + vsed -i -e "s|^FINAL_LIBS=.*|& -latomic|" src/Makefile + fi } do_install() {