Fix several ARM nvram utility bugsToastman-1.28.8510.1
commit0152c48814c912f8b4e64d4cdcd3d5eb85ffc6a0
authorJeremy Chadwick <kdc@koitsu.org>
Thu, 29 Dec 2016 06:54:44 +0000 (29 13:54 +0700)
committerJeremy Chadwick <jdc@koitsu.org>
Thu, 29 Dec 2016 08:33:05 +0000 (29 15:33 +0700)
treea2d2cf491ae046da9194c4de8e1cbd1d8825ceec
parentf02d2966e1657b97875ab2d30f2ac1ab52c28742
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