Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 21e5b6edfa | |||
| 48ac7fdd87 |
@ -1 +0,0 @@
|
||||
1
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,8 +1 @@
|
||||
/valkey-7.2.5.tar.gz
|
||||
/valkey-7.2.6.tar.gz
|
||||
/valkey-8.0.2.tar.gz
|
||||
/valkey-8.0.3.tar.gz
|
||||
/valkey-8.0.4.tar.gz
|
||||
/valkey-8.0.6.tar.gz
|
||||
/valkey-8.0.7.tar.gz
|
||||
/valkey-8.1.6.tar.gz
|
||||
SOURCES/valkey-8.0.4.tar.gz
|
||||
|
||||
1
.valkey.metadata
Normal file
1
.valkey.metadata
Normal file
@ -0,0 +1 @@
|
||||
e8c4b2736e6c1957890dd758e8617747f76399d2 SOURCES/valkey-8.0.4.tar.gz
|
||||
2
SOURCES/macros.valkey
Normal file
2
SOURCES/macros.valkey
Normal file
@ -0,0 +1,2 @@
|
||||
%valkey_modules_abi 1
|
||||
%valkey_modules_dir %{_libdir}/valkey/modules
|
||||
@ -2,8 +2,8 @@
|
||||
%bcond_with tests
|
||||
|
||||
Name: valkey
|
||||
Version: 8.1.6
|
||||
Release: 1%{?dist}
|
||||
Version: 8.0.4
|
||||
Release: 3%{?dist}
|
||||
Summary: A persistent key-value database
|
||||
# valkey: BSD-3-Clause
|
||||
# hiredis: BSD-3-Clause
|
||||
@ -18,15 +18,10 @@ Source2: %{name}-sentinel.service
|
||||
Source3: %{name}.service
|
||||
Source4: %{name}.sysusers
|
||||
Source5: %{name}.tmpfiles
|
||||
Source8: macros.%{name}
|
||||
Source9: migrate_redis_to_valkey.sh
|
||||
|
||||
Patch1: valkey-cve-2025-27151.patch
|
||||
# Fix default paths in configuration files for RPM layout
|
||||
Patch2: %{name}-conf.patch
|
||||
# Workaround to https://github.com/valkey-io/valkey/issues/2678
|
||||
Patch3: %{name}-loadmod.patch
|
||||
#Fix linker flags: https://github.com/valkey-io/valkey/pull/3344
|
||||
Patch4: %{name}-bindnow.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
@ -37,7 +32,6 @@ BuildRequires: tcl
|
||||
BuildRequires: pkgconfig(libsystemd)
|
||||
BuildRequires: systemd-devel
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: rdma-core-devel
|
||||
BuildRequires: openssl-devel
|
||||
Requires: logrotate
|
||||
# from deps/hiredis/hiredis.h
|
||||
@ -56,7 +50,6 @@ Provides: bundled(fpconv)
|
||||
|
||||
%global valkey_modules_abi 1
|
||||
%global valkey_modules_dir %{_libdir}/%{name}/modules
|
||||
%global valkey_modules_cfg %{_sysconfdir}/%{name}/modules
|
||||
Provides: valkey(modules_abi)%{?_isa} = %{valkey_modules_abi}
|
||||
|
||||
ExcludeArch: %{ix86}
|
||||
@ -90,20 +83,10 @@ You can use Valkey from most programming languages also.
|
||||
Summary: Development header for Valkey module development
|
||||
# Header-Only Library (https://fedoraproject.org/wiki/Packaging:Guidelines)
|
||||
Provides: %{name}-static = %{version}-%{release}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Header file required for building loadable Valkey modules.
|
||||
|
||||
%package rdma
|
||||
Summary: RDMA module for %{name}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Supplements: %{name}
|
||||
|
||||
%description rdma
|
||||
%summary.
|
||||
|
||||
See https://valkey.io/topics/RDMA/
|
||||
|
||||
%package compat-redis
|
||||
Summary: Conversion script and compatibility symlinks for Redis
|
||||
@ -124,9 +107,6 @@ BuildArch: noarch
|
||||
%prep
|
||||
%setup -qn %{name}-%{version}
|
||||
%patch -P1 -p1
|
||||
%patch -P2 -p1 -b.rpm
|
||||
%patch -P3 -p1 -b .loadmod
|
||||
%patch -P4 -p1 -b .bindnow
|
||||
|
||||
mv deps/lua/COPYRIGHT COPYRIGHT-lua
|
||||
mv deps/jemalloc/COPYING COPYING-jemalloc
|
||||
@ -148,17 +128,19 @@ sed -e 's/--with-lg-quantum/--with-lg-page=16 --with-lg-quantum/' -i deps/Makefi
|
||||
api=`sed -n -e 's/#define VALKEYMODULE_APIVER_[0-9][0-9]* //p' src/valkeymodule.h`
|
||||
if test "$api" != "%{valkey_modules_abi}"; then
|
||||
: Error: Upstream API version is now ${api}, expecting %%{valkey_modules_abi}.
|
||||
: Update the valkey_modules_abi macro, and rebuild.
|
||||
: Update the valkey_modules_abi macro, the rpmmacros file, and rebuild.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generates macro file
|
||||
cat << 'EOF' | tee macros.%{name}
|
||||
%%valkey_version %version
|
||||
%%valkey_modules_abi %valkey_modules_abi
|
||||
%%valkey_modules_dir %valkey_modules_dir
|
||||
%%valkey_modules_cfg %valkey_modules_cfg
|
||||
EOF
|
||||
|
||||
sed -i -e 's|^logfile .*$|logfile /var/log/valkey/valkey.log|g' \
|
||||
-e 's|^# unixsocket .*$|unixsocket /run/valkey/valkey.sock|g' \
|
||||
-e 's|^pidfile .*$|pidfile /run/valkey/valkey.pid|g' \
|
||||
valkey.conf
|
||||
|
||||
sed -i -e 's|^logfile .*$|logfile /var/log/valkey/sentinel.log|g' \
|
||||
-e 's|^pidfile .*$|pidfile /run/valkey/sentinel.pid|g' \
|
||||
sentinel.conf
|
||||
|
||||
%if (%{defined fedora} && 0%{?fedora} < 42) || (%{defined rhel} && 0%{?rhel} < 10)
|
||||
# these lines are for conditionals around sysconfig to valkey.conf porting scriptlets to avoid re-runs
|
||||
@ -166,13 +148,8 @@ echo '# valkey_rpm_conf' >> valkey.conf
|
||||
echo '# valkey-sentinel_rpm_conf' >> sentinel.conf
|
||||
%endif
|
||||
|
||||
%global make_flags DEBUG="" V="echo" PREFIX=%{buildroot}%{_prefix} BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes BUILD_RDMA=module
|
||||
%global make_flags DEBUG="" V="echo" PREFIX=%{buildroot}%{_prefix} BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes
|
||||
|
||||
: RDMA configuration file
|
||||
cat << EOF | tee rdma.conf
|
||||
# RDMA module
|
||||
loadmodule %{valkey_modules_dir}/rdma.so
|
||||
EOF
|
||||
|
||||
%build
|
||||
%make_build %{make_flags}
|
||||
@ -202,7 +179,6 @@ install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
||||
# Install configuration files.
|
||||
install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
|
||||
install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}/sentinel.conf
|
||||
install -dm750 %{buildroot}%{valkey_modules_cfg}
|
||||
|
||||
# Install systemd unit files.
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
@ -217,15 +193,11 @@ install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h
|
||||
|
||||
# Install rpm macros for valkey modules
|
||||
#mkdir -p %{buildroot}%{_rpmmacrodir}
|
||||
install -pDm644 macros.%{name} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
||||
install -pDm644 %{S:8} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
||||
|
||||
# compat script
|
||||
install -Dpm 755 %{S:9} %{buildroot}%{_libexecdir}/migrate_redis_to_valkey.sh
|
||||
|
||||
# RDMA module
|
||||
install -pm755 src/valkey-rdma.so %{buildroot}%{valkey_modules_dir}/rdma.so
|
||||
install -pm640 rdma.conf %{buildroot}%{valkey_modules_cfg}/rdma.conf
|
||||
|
||||
|
||||
%check
|
||||
%if %{with tests}
|
||||
@ -269,7 +241,6 @@ taskset -c 1 ./runtest --clients 50 --skiptest "Active defrag - AOF loading"
|
||||
%license COPYING-hiredis-BSD-3-Clause
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
||||
%attr(0750, valkey, root) %dir %{_sysconfdir}/%{name}
|
||||
%attr(0750, valkey, root) %dir %{valkey_modules_cfg}
|
||||
%attr(0640, valkey, root) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
|
||||
%attr(0640, valkey, root) %config(noreplace) %{_sysconfdir}/%{name}/sentinel.conf
|
||||
%dir %{_libdir}/%{name}
|
||||
@ -283,9 +254,6 @@ taskset -c 1 ./runtest --clients 50 --skiptest "Active defrag - AOF loading"
|
||||
%{_sysusersdir}/%{name}.conf
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
%files rdma
|
||||
%attr(0640, valkey, root) %config(noreplace) %{valkey_modules_cfg}/rdma.conf
|
||||
%{valkey_modules_dir}/rdma.so
|
||||
|
||||
%files devel
|
||||
# main package is not required
|
||||
@ -300,25 +268,7 @@ taskset -c 1 ./runtest --clients 50 --skiptest "Active defrag - AOF loading"
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Mar 04 2026 Lukas Javorsky <ljavorsk@redhat.com> - 8.1.6-1
|
||||
- Rebase to version 8.1
|
||||
- fix CONFIG REWRITE breaks configuration
|
||||
reported as https://github.com/valkey-io/valkey/issues/2678
|
||||
using patch from https://github.com/valkey-io/valkey/pull/2689
|
||||
- add sub-package for rdma module
|
||||
- use patch for configuration changes
|
||||
- add /etc/valkey/modules drop-in directory for module configuration files
|
||||
- add %%valkey_version and %%valkey_modules_cfg macros
|
||||
- fix module linker flags using patch from
|
||||
https://github.com/valkey-io/valkey/pull/3344
|
||||
|
||||
* Mon Mar 02 2026 Lukas Javorsky <ljavorsk@redhat.com> - 8.0.7-1
|
||||
- Rebase to 8.0.7 for CVE-2026-21863 CVE-2025-67733
|
||||
|
||||
* Fri Oct 17 2025 Remi Collet <remi@fedoraproject.org> - 8.0.6-2
|
||||
- rebase to 8.0.6 for CVE-2025-49844 CVE-2025-46817 CVE-2025-46818 CVE-2025-46819
|
||||
|
||||
* Mon Sep 8 2025 Remi Collet <remi@fedoraproject.org> - 8.0.4-3
|
||||
* Tue Sep 9 2025 Remi Collet <remi@fedoraproject.org> - 8.0.4-3
|
||||
- fix ImageMode: ensure ownership of /etc/valkey
|
||||
|
||||
* Fri Aug 1 2025 Remi Collet <remi@fedoraproject.org> - 8.0.4-2
|
||||
@ -1,7 +0,0 @@
|
||||
#gating rhel
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-*
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}
|
||||
@ -1,10 +0,0 @@
|
||||
summary: Internal Tier1 beakerlib tests
|
||||
discover:
|
||||
how: fmf
|
||||
url: https://gitlab.com/redhat/rhel/tests/valkey
|
||||
filter: "tier:1"
|
||||
execute:
|
||||
how: tmt
|
||||
adjust:
|
||||
enabled: false
|
||||
when: distro == centos-stream-10
|
||||
1
sources
1
sources
@ -1 +0,0 @@
|
||||
SHA512 (valkey-8.1.6.tar.gz) = c991e8019637842305c394b25253f609e0ea02ebd53b71e6730ce0107e9957c04e3e7ae8e6779cfd698434c477c255f5e3beb27ebc24a280a7a6e5a640333e25
|
||||
@ -1,51 +0,0 @@
|
||||
Adapted for 8.1/9.0 from
|
||||
|
||||
|
||||
From 8051de740dd38172476b04e892e5517630e3eaed Mon Sep 17 00:00:00 2001
|
||||
From: Remi Collet <remi@remirepo.net>
|
||||
Date: Wed, 11 Mar 2026 11:40:15 +0100
|
||||
Subject: [PATCH] Inherit LDFLAGS for TLS and RDMA modules (#3344)
|
||||
|
||||
With current Makefile, `LDFLAGS` are not used for modules.
|
||||
|
||||
This results in security options not applied.
|
||||
|
||||
```
|
||||
$ annocheck /usr/lib64/valkey/modules/rdma.so
|
||||
annocheck: Version 12.99.
|
||||
Hardened: rdma.so: FAIL: bind-now test because not linked with -Wl,-z,now
|
||||
Hardened: Rerun annocheck with --verbose to see more information on the tests.
|
||||
Hardened: rdma.so: Overall: FAIL.
|
||||
```
|
||||
|
||||
With this patch
|
||||
|
||||
```
|
||||
$ annocheck /usr/lib64/valkey/modules/rdma.so
|
||||
annocheck: Version 12.99.
|
||||
Hardened: rdma.so: PASS.
|
||||
```
|
||||
|
||||
Signed-off-by: Remi Collet <remi@remirepo.net>
|
||||
---
|
||||
src/Makefile | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index eb4a6e939a..5d3814d019 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -524,11 +524,11 @@ $(ENGINE_CHECK_AOF_NAME): $(SERVER_NAME)
|
||||
|
||||
# valkey-tls.so
|
||||
$(TLS_MODULE_NAME): $(SERVER_NAME)
|
||||
- $(QUIET_CC)$(CC) -o $@ tls.c -shared -fPIC $(TLS_MODULE_CFLAGS) $(TLS_CLIENT_LIBS)
|
||||
+ $(QUIET_CC)$(CC) $(LDFLAGS) -o $@ tls.c -shared -fPIC $(TLS_MODULE_CFLAGS) $(TLS_CLIENT_LIBS)
|
||||
|
||||
# valkey-rdma.so
|
||||
$(RDMA_MODULE_NAME): $(SERVER_NAME)
|
||||
- $(QUIET_CC)$(CC) -o $@ rdma.c -shared -fPIC $(RDMA_MODULE_CFLAGS)
|
||||
+ $(QUIET_CC)$(CC) $(LDFLAGS) -o $@ rdma.c -shared -fPIC $(RDMA_MODULE_CFLAGS)
|
||||
|
||||
# valkey-cli
|
||||
$(ENGINE_CLI_NAME): $(ENGINE_CLI_OBJ)
|
||||
@ -1,61 +0,0 @@
|
||||
diff -up ./sentinel.conf.rpm ./sentinel.conf
|
||||
--- ./sentinel.conf.rpm 2025-07-24 10:05:46.477794769 +0200
|
||||
+++ ./sentinel.conf 2025-07-24 10:07:27.023483441 +0200
|
||||
@@ -17,7 +17,7 @@ daemonize no
|
||||
# When running daemonized, Valkey Sentinel writes a pid file in
|
||||
# /var/run/valkey-sentinel.pid by default. You can specify a custom pid file
|
||||
# location here.
|
||||
-pidfile /var/run/valkey-sentinel.pid
|
||||
+pidfile /run/valkey/sentinel.pid
|
||||
|
||||
# Specify the server verbosity level.
|
||||
# This can be one of:
|
||||
@@ -31,7 +31,7 @@ loglevel notice
|
||||
# Specify the log file name. Also the empty string can be used to force
|
||||
# Sentinel to log on the standard output. Note that if you use standard
|
||||
# output for logging but daemonize, logs will be sent to /dev/null
|
||||
-logfile ""
|
||||
+logfile /var/log/valkey/sentinel.log
|
||||
|
||||
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
|
||||
# and optionally update the other syslog parameters to suit your needs.
|
||||
diff -up ./valkey.conf.rpm ./valkey.conf
|
||||
--- ./valkey.conf.rpm 2025-07-24 10:05:46.475591081 +0200
|
||||
+++ ./valkey.conf 2025-07-24 10:07:23.219331838 +0200
|
||||
@@ -43,6 +43,9 @@
|
||||
# include /path/to/other.conf
|
||||
# include /path/to/fragments/*.conf
|
||||
#
|
||||
+# Module configuration files
|
||||
+include /etc/valkey/modules/*.conf
|
||||
+
|
||||
|
||||
################################## MODULES #####################################
|
||||
|
||||
@@ -153,7 +156,7 @@ tcp-backlog 511
|
||||
# incoming connections. There is no default, so the server will not listen
|
||||
# on a unix socket when not specified.
|
||||
#
|
||||
-# unixsocket /run/valkey.sock
|
||||
+unixsocket /run/valkey/valkey.sock
|
||||
# unixsocketgroup wheel
|
||||
# unixsocketperm 700
|
||||
|
||||
@@ -385,7 +388,7 @@ daemonize no
|
||||
#
|
||||
# Note that on modern Linux systems "/run/valkey.pid" is more conforming
|
||||
# and should be used instead.
|
||||
-pidfile /var/run/valkey_6379.pid
|
||||
+pidfile /run/valkey/valkey.pid
|
||||
|
||||
# Specify the server verbosity level.
|
||||
# This can be one of:
|
||||
@@ -416,7 +419,7 @@ loglevel notice
|
||||
# Specify the log file name. Also the empty string can be used to force
|
||||
# the server to log on the standard output. Note that if you use standard
|
||||
# output for logging but daemonize, logs will be sent to /dev/null
|
||||
-logfile ""
|
||||
+logfile /var/log/valkey/valkey.log
|
||||
|
||||
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
|
||||
# and optionally update the other syslog parameters to suit your needs.
|
||||
@ -1,147 +0,0 @@
|
||||
Adapted for 8.1.4 from
|
||||
https://github.com/valkey-io/valkey/pull/2689
|
||||
|
||||
diff -up ./src/config.c.loadmod ./src/config.c
|
||||
--- ./src/config.c.loadmod 2025-10-03 21:17:43.000000000 +0200
|
||||
+++ ./src/config.c 2025-10-06 03:06:41.774448336 +0200
|
||||
@@ -438,6 +438,8 @@ static int updateClientOutputBufferLimit
|
||||
* within conf file parsing. This is only needed to support the deprecated
|
||||
* abnormal aggregate `save T C` functionality. Remove in the future. */
|
||||
static int reading_config_file;
|
||||
+/* support detecting include vs main config file */
|
||||
+static int reading_include_file = 0;
|
||||
|
||||
void loadServerConfigFromString(char *config) {
|
||||
deprecatedConfig deprecated_configs[] = {
|
||||
@@ -529,7 +531,9 @@ void loadServerConfigFromString(char *co
|
||||
|
||||
/* Execute config directives */
|
||||
if (!strcasecmp(argv[0], "include") && argc == 2) {
|
||||
+ reading_include_file = 1;
|
||||
loadServerConfig(argv[1], 0, NULL);
|
||||
+ reading_include_file = 0;
|
||||
} else if (!strcasecmp(argv[0], "rename-command") && argc == 3) {
|
||||
struct serverCommand *cmd = lookupCommandBySds(argv[1]);
|
||||
|
||||
@@ -562,7 +566,7 @@ void loadServerConfigFromString(char *co
|
||||
goto loaderr;
|
||||
}
|
||||
} else if (!strcasecmp(argv[0], "loadmodule") && argc >= 2) {
|
||||
- moduleEnqueueLoadModule(argv[1], &argv[2], argc - 2);
|
||||
+ moduleEnqueueLoadModule(argv[1], &argv[2], argc - 2, reading_include_file);
|
||||
} else if (strchr(argv[0], '.')) {
|
||||
if (argc < 2) {
|
||||
err = "Module config specified without value";
|
||||
@@ -1579,7 +1583,7 @@ void rewriteConfigLoadmoduleOption(struc
|
||||
while ((de = dictNext(di)) != NULL) {
|
||||
struct ValkeyModule *module = dictGetVal(de);
|
||||
line = moduleLoadQueueEntryToLoadmoduleOptionStr(module, "loadmodule");
|
||||
- rewriteConfigRewriteLine(state, "loadmodule", line, 1);
|
||||
+ if (line) rewriteConfigRewriteLine(state, "loadmodule", line, 1);
|
||||
}
|
||||
dictReleaseIterator(di);
|
||||
/* Mark "loadmodule" as processed in case modules is empty. */
|
||||
diff -up ./src/module.c.loadmod ./src/module.c
|
||||
--- ./src/module.c.loadmod 2025-10-03 21:17:43.000000000 +0200
|
||||
+++ ./src/module.c 2025-10-06 03:05:36.498290506 +0200
|
||||
@@ -83,6 +83,7 @@
|
||||
|
||||
struct moduleLoadQueueEntry {
|
||||
sds path;
|
||||
+ int from_include;
|
||||
int argc;
|
||||
robj **argv;
|
||||
};
|
||||
@@ -669,7 +670,7 @@ void freeClientModuleData(client *c) {
|
||||
c->module_data = NULL;
|
||||
}
|
||||
|
||||
-void moduleEnqueueLoadModule(sds path, sds *argv, int argc) {
|
||||
+void moduleEnqueueLoadModule(sds path, sds *argv, int argc, int from_include) {
|
||||
int i;
|
||||
struct moduleLoadQueueEntry *loadmod;
|
||||
|
||||
@@ -677,6 +678,7 @@ void moduleEnqueueLoadModule(sds path, s
|
||||
loadmod->argv = argc ? zmalloc(sizeof(robj *) * argc) : NULL;
|
||||
loadmod->path = sdsnew(path);
|
||||
loadmod->argc = argc;
|
||||
+ loadmod->from_include = from_include;
|
||||
for (i = 0; i < argc; i++) {
|
||||
loadmod->argv[i] = createRawStringObject(argv[i], sdslen(argv[i]));
|
||||
}
|
||||
@@ -687,6 +689,10 @@ sds moduleLoadQueueEntryToLoadmoduleOpti
|
||||
const char *config_option_str) {
|
||||
sds line;
|
||||
|
||||
+ if (module->loadmod->from_include) {
|
||||
+ /* no need to add as already from config */
|
||||
+ return NULL;
|
||||
+ }
|
||||
line = sdsnew(config_option_str);
|
||||
line = sdscatlen(line, " ", 1);
|
||||
line = sdscatsds(line, module->loadmod->path);
|
||||
@@ -12188,7 +12194,7 @@ void moduleLoadFromQueue(void) {
|
||||
listRewind(server.loadmodule_queue, &li);
|
||||
while ((ln = listNext(&li))) {
|
||||
struct moduleLoadQueueEntry *loadmod = ln->value;
|
||||
- if (moduleLoad(loadmod->path, (void **)loadmod->argv, loadmod->argc, 0) == C_ERR) {
|
||||
+ if (moduleLoad(loadmod->path, (void **)loadmod->argv, loadmod->argc, 0, loadmod->from_include) == C_ERR) {
|
||||
serverLog(LL_WARNING, "Can't load module from %s: server aborting", loadmod->path);
|
||||
exit(1);
|
||||
}
|
||||
@@ -12369,7 +12375,7 @@ void moduleUnregisterCleanup(ValkeyModul
|
||||
|
||||
/* Load a module and initialize it. On success C_OK is returned, otherwise
|
||||
* C_ERR is returned. */
|
||||
-int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loadex) {
|
||||
+int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loadex, int from_include) {
|
||||
int (*onload)(void *, void **, int);
|
||||
void *handle;
|
||||
|
||||
@@ -12444,6 +12450,7 @@ int moduleLoad(const char *path, void **
|
||||
ctx.module->loadmod->path = sdsnew(path);
|
||||
ctx.module->loadmod->argv = module_argc ? zmalloc(sizeof(robj *) * module_argc) : NULL;
|
||||
ctx.module->loadmod->argc = module_argc;
|
||||
+ ctx.module->loadmod->from_include = from_include;
|
||||
for (int i = 0; i < module_argc; i++) {
|
||||
ctx.module->loadmod->argv[i] = module_argv[i];
|
||||
incrRefCount(ctx.module->loadmod->argv[i]);
|
||||
@@ -13361,7 +13368,7 @@ void moduleCommand(client *c) {
|
||||
argv = &c->argv[3];
|
||||
}
|
||||
|
||||
- if (moduleLoad(c->argv[2]->ptr, (void **)argv, argc, 0) == C_OK)
|
||||
+ if (moduleLoad(c->argv[2]->ptr, (void **)argv, argc, 0, 0) == C_OK)
|
||||
addReply(c, shared.ok);
|
||||
else
|
||||
addReplyError(c, "Error loading the extension. Please check the server logs.");
|
||||
@@ -13376,7 +13383,7 @@ void moduleCommand(client *c) {
|
||||
/* If this is a loadex command we want to populate server.module_configs_queue with
|
||||
* sds NAME VALUE pairs. We also want to increment argv to just after ARGS, if supplied. */
|
||||
if (parseLoadexArguments((ValkeyModuleString ***)&argv, &argc) == VALKEYMODULE_OK &&
|
||||
- moduleLoad(c->argv[2]->ptr, (void **)argv, argc, 1) == C_OK)
|
||||
+ moduleLoad(c->argv[2]->ptr, (void **)argv, argc, 1, 0) == C_OK)
|
||||
addReply(c, shared.ok);
|
||||
else {
|
||||
dictEmpty(server.module_configs_queue, NULL);
|
||||
diff -up ./src/module.h.loadmod ./src/module.h
|
||||
--- ./src/module.h.loadmod 2025-10-03 21:17:43.000000000 +0200
|
||||
+++ ./src/module.h 2025-10-06 03:05:36.498698194 +0200
|
||||
@@ -169,7 +169,7 @@ static inline void moduleInitDigestConte
|
||||
memset(mdvar->x, 0, sizeof(mdvar->x));
|
||||
}
|
||||
|
||||
-void moduleEnqueueLoadModule(sds path, sds *argv, int argc);
|
||||
+void moduleEnqueueLoadModule(sds path, sds *argv, int argc, int from_include);
|
||||
sds moduleLoadQueueEntryToLoadmoduleOptionStr(ValkeyModule *module,
|
||||
const char *config_option_str);
|
||||
ValkeyModuleCtx *moduleAllocateContext(void);
|
||||
@@ -180,7 +180,7 @@ void moduleFreeContext(ValkeyModuleCtx *
|
||||
void moduleInitModulesSystem(void);
|
||||
void moduleInitModulesSystemLast(void);
|
||||
void modulesCron(void);
|
||||
-int moduleLoad(const char *path, void **argv, int argc, int is_loadex);
|
||||
+int moduleLoad(const char *path, void **argv, int argc, int is_loadex, int from_include);
|
||||
int moduleUnload(sds name, const char **errmsg);
|
||||
void moduleLoadFromQueue(void);
|
||||
int moduleGetCommandKeysViaAPI(struct serverCommand *cmd, robj **argv, int argc, getKeysResult *result);
|
||||
Loading…
Reference in New Issue
Block a user