libubox/tests/cram/test_blobmsg_procd_instance.t
Petr Štetiar cd75136b13 blobmsg: fix wrong payload len passed from blobmsg_check_array
Fix incorrect use of blob_raw_len() on passed blobmsg to
blobmsg_check_array_len()  introduced in commit b0e21553ae ("blobmsg:
add _len variants for all attribute checking methods") by using correct
blobmsg_len().

This wrong (higher) length was then for example causing issues in
procd's instance_config_parse_command() where blobmsg_check_attr_list()
was failing sanity checking of service command, thus resulting in the
startup failures of some services like collectd, nlbwmon and samba4.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020840.html
Fixes: b0e21553ae ("blobmsg: add _len variants for all attribute checking methods")
Reported-by: Hannu Nyman <hannu.nyman@welho.com>
Tested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-12-28 21:17:46 +01:00

11 lines
440 B
Raku

check that blobmsg parsing/checking would produce expected results in procd:
$ [ -n "$TEST_BIN_DIR" ] && export PATH="$TEST_BIN_DIR:$PATH"
$ export INPUTS="$TESTDIR/inputs"
$ for blob in $(LC_ALL=C find $INPUTS -type f | sort ); do
> valgrind --quiet --leak-check=full test-blobmsg-procd-instance $blob; \
> test-blobmsg-procd-instance-san $blob; \
> done
procd-instance-nlbwmon.bin: OK
procd-instance-nlbwmon.bin: OK