1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-19 05:58:53 +02:00
openwrt/package
Jo-Philipp Wich 4a6795409d base-files: functions.sh: fix config_get() on invalid identifiers
When passing a section or option value to config_get() which contains
characters that happen to be valid variable interpolation expressions,
the function returns a nonsensical expression result instead of the
expected empty string.

When the passed section or option name contains other characters which
are not valid within a shell variable name, a substitution error is
occuring instead.

The issue can be easily reproduced by one of the following examples:

    root@OpenWrt:~# . /lib/functions.sh
    root@OpenWrt:~# config load system
    root@OpenWrt:~# config_get variable invalid-section option
    root@OpenWrt:~# echo "$variable"
    section_option:-

    root@OpenWrt:~# . /lib/functions.sh
    root@OpenWrt:~# config load system
    root@OpenWrt:~# config_get variable section invalid-option
    root@OpenWrt:~# echo "$variable"
    option:-

    root@OpenWrt:~# . /lib/functions.sh
    root@OpenWrt:~# config load system
    root@OpenWrt:~# config_get variable section invalid@option
    -ash: eval: syntax error: bad substitution

Fix this issue by only performing interpolations when the given section
and option arguments are free of illegal characters.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-07 11:05:16 +02:00
..
base-files base-files: functions.sh: fix config_get() on invalid identifiers 2020-08-07 11:05:16 +02:00
boot ath79/nand: add support for Netgear WNDR4300TN 2020-08-06 16:56:07 +02:00
devel binutils: update to version 2.34 2020-08-06 12:42:16 +02:00
firmware layerscape: harmonize device strings 2020-07-27 12:06:52 +02:00
kernel Revert "procd: update to git HEAD" 2020-08-06 16:17:37 +01:00
libs libubox: update to git HEAD 2020-08-06 15:27:51 +01:00
network dnsmasq: abort when dnssec requested but not available 2020-08-07 15:56:30 +08:00
system procd: update to git HEAD 2020-08-06 16:17:37 +01:00
utils ravpower-mcu: bump PKG_RELEASE 2020-07-15 09:56:23 +02:00
Makefile