openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.05k stars 3.51k forks source link

luci-app-fwknopd: gen-qr.sh produces error output in BusyBox ash #4796

Closed leonyu closed 5 years ago

leonyu commented 7 years ago

Maintainer: @jp-bennett Environment: LEDE 17.01.2 on Linksys WRT1900AC

Description:

When opening the LuCI config page for fwknopd, following error is produced:

Sat Sep  2 00:50:11 2017 daemon.err uhttpd[1817]: uci: Entry not found
Sat Sep  2 00:50:11 2017 daemon.err uhttpd[1817]: uci: Entry not found
Sat Sep  2 00:50:11 2017 daemon.err uhttpd[1817]: sh: : unknown operand
Sat Sep  2 00:50:11 2017 daemon.err uhttpd[1817]: sh: : unknown operand

It appears the error originate from /usr/sbin/gen-qr.sh, as I am able to get the same error running that shell script in a terminal.

I think the unknown operand error is caused missing quotes in the if statement: if [ $key_base64 != "" ]; then vs if [ "$key_base64" != "" ]; then.

I am not sure what causes Entry not found error.

hnyman commented 7 years ago

Sounds like a possible duplicate of #3325 for luci-app-fwknopd, but that bug was supposed to be fixed in January.

jp-bennett commented 7 years ago

The missing quotation marks is causing the unknown operator, but only when the key variables are empty. This is essentially harmless noise, but for correctness I'll add the quotation marks as suggested.

jp-bennett commented 7 years ago

Pull request to fix this is over at https://github.com/openwrt/luci/pull/1393

feckert commented 5 years ago

This was fixed in https://github.com/openwrt/luci/pull/1393 and was merged so I will close this