From f3afdc078eb8738c595ed97b187d71112f095dc5 Mon Sep 17 00:00:00 2001 From: adamiBs Date: Thu, 19 Sep 2024 15:33:26 +0300 Subject: [PATCH] Deprecate usage of eval in `docker-entrypoint.sh` (#12) `eval` is riskier due to potential security vulnerabilities and unpredictable behavior when handling arguments. --- alpine/docker-entrypoint.sh | 5 +++-- debian/docker-entrypoint.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alpine/docker-entrypoint.sh b/alpine/docker-entrypoint.sh index 114e094d..f7d408c0 100755 --- a/alpine/docker-entrypoint.sh +++ b/alpine/docker-entrypoint.sh @@ -48,12 +48,13 @@ if [ "$1" = 'redis-server' ]; then if [ ! -x "$module" ]; then echo "Warning: Module $module is not executable." + continue fi - command="$command --loadmodule $module" + set -- "$@" --loadmodule "$module" done fi fi -eval "$command" \ No newline at end of file +exec "$@" \ No newline at end of file diff --git a/debian/docker-entrypoint.sh b/debian/docker-entrypoint.sh index 114e094d..f7d408c0 100755 --- a/debian/docker-entrypoint.sh +++ b/debian/docker-entrypoint.sh @@ -48,12 +48,13 @@ if [ "$1" = 'redis-server' ]; then if [ ! -x "$module" ]; then echo "Warning: Module $module is not executable." + continue fi - command="$command --loadmodule $module" + set -- "$@" --loadmodule "$module" done fi fi -eval "$command" \ No newline at end of file +exec "$@" \ No newline at end of file