Fix several ARM nvram utility bugsToastman-1.28.9008.4
commit198bcc0665d00eba9da9f46e882943e6a19089ab
authorJeremy Chadwick <kdc@koitsu.org>
Thu, 29 Dec 2016 06:54:44 +0000 (29 13:54 +0700)
committerJeremy Chadwick <kdc@koitsu.org>
Thu, 29 Dec 2016 06:54:44 +0000 (29 13:54 +0700)
treec08d9d99617f70e283cd20244e160f5f97524d5b
parent07dae882550f22f5644c7833c78461e96ed2dd1f
Fix several ARM nvram utility bugs

These fixes come directly from AsusWRT/Merlin.

nvram save -- would output every NVRAM key/value to stdout
due to #ifdef/#endif conditions being commented out

nvram restore -- depending on what characters were used in
NVRAM variables (keys or values), and the obfuscation method
involving random numbers implemented by Asus, it was possible
that certain values, ranges, or byte sequences of characters
may cause restoration problems.

nvram usage syntax -- restore showing the usage syntax if
there are no matching arguments, i.e. "nvram djdsjqd" should
now show usage syntax rather than nothing.

Reference: https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/nvram_arm/main.c
Reference: http://www.linksysinfo.org/index.php?threads/tomato-arm-cfg-file.73093/#post-282981
release/src-rt-6.x.4708/router/nvram_arm/main.c