base-files: config_get: prevent filename globbing
authorGünther Kelleter <guenther.kelleter@devolo.de>
Mon, 8 Oct 2018 13:30:00 +0000 (15:30 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 30 Jan 2019 12:21:02 +0000 (13:21 +0100)
When config_get is called as "config_get section option" the option
is unexpectedly globbed by the shell which differs from the way options
are read to a variable with "config_get variable section option".
Add another layer of double quotes to fix it.

Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
(backported from commit c3389ab135400fba0cb710d9c6c63df2f563d9d9)

package/base-files/Makefile
package/base-files/files/lib/functions.sh

index 9134f118e0d0cce48df2add9da229ccb08041585..904f4af073bbf406442d0227455b32d498dfddc3 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=194.1
+PKG_RELEASE:=194.2
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
index 50a7b408698cbf5141d65f1f4eaf851c16d84876..edce75e8ff877aa28adea5b58463a95b19f8f7e2 100755 (executable)
@@ -92,7 +92,7 @@ config_unset() {
 # config_get <section> <option>
 config_get() {
        case "$3" in
-               "") eval echo "\${CONFIG_${1}_${2}:-\${4}}";;
+               "") eval echo "\"\${CONFIG_${1}_${2}:-\${4}}\"";;
                *)  eval export ${NO_EXPORT:+-n} -- "${1}=\${CONFIG_${2}_${3}:-\${4}}";;
        esac
 }