summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions.sh
diff options
context:
space:
mode:
authorGünther Kelleter <guenther.kelleter@devolo.de>2018-10-08 15:30:00 +0200
committerJo-Philipp Wich <jo@mein.io>2019-01-30 13:20:14 +0100
commitc3389ab135400fba0cb710d9c6c63df2f563d9d9 (patch)
tree5732e56a4c03e7773f665822b9cc88edae542e08 /package/base-files/files/lib/functions.sh
parent37e91861cc6b1988531e2c68131d65053e7dd230 (diff)
downloadopenwrt-c3389ab135400fba0cb710d9c6c63df2f563d9d9.tar.gz
openwrt-c3389ab135400fba0cb710d9c6c63df2f563d9d9.tar.bz2
openwrt-c3389ab135400fba0cb710d9c6c63df2f563d9d9.zip
base-files: config_get: prevent filename globbing
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>
Diffstat (limited to 'package/base-files/files/lib/functions.sh')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 50a7b40869..edce75e8ff 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -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
}