Skip to content

Commit

Permalink
redis: update to 7.0.8.
Browse files Browse the repository at this point in the history
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@b7b9aa6

* do_configure is renamed to post_patch as its contents fit the
  latter's purpose.
  • Loading branch information
Krul Ceter authored and leahneukirchen committed Jan 22, 2023
1 parent 7dadf95 commit 5367bf2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion srcpkgs/redis/patches/use-system-jemalloc.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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)
40 changes: 22 additions & 18 deletions srcpkgs/redis/template
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
# 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 <gottox@voidlinux.org>"
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"
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

if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
makedepends+=" libatomic-devel"
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() {
Expand Down

0 comments on commit 5367bf2

Please sign in to comment.