[PATCH 4/5] Quote parameters when calling logging functions

Trek trek00 at inbox.ru
Tue Apr 26 22:48:19 BST 2022


Passing unquoted parameters could lead to unexpected behaviors,
like whitespace trimming or pathname expansion.

Thanks: Bjarni Ingi Gislason <bjarniig at rhi.hi.is>
Closes: #660790
---
 init-functions | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/init-functions b/init-functions
index 1c5219e..1760a3b 100644
--- a/init-functions
+++ b/init-functions
@@ -226,21 +226,21 @@ log_use_fancy_output () {
 
 log_success_msg () {
     if [ -n "${1:-}" ]; then
-        log_begin_msg $@
+        log_begin_msg "$@"
     fi
     log_end_msg 0
 }
 
 log_failure_msg () {
     if [ -n "${1:-}" ]; then
-        log_begin_msg $@ "..."
+        log_begin_msg "$@" "..."
     fi
     log_end_msg 1 || true
 }
 
 log_warning_msg () {
     if [ -n "${1:-}" ]; then
-        log_begin_msg $@ "..."
+        log_begin_msg "$@" "..."
     fi
     log_end_msg 255 || true
 }
-- 
2.20.1



More information about the Debian-init-diversity mailing list