openwrt/package/system
Christian Marangi 2541ff391f
procd: make mDNS TXT record parsing more solid
mDNS broadcast can't accept empty TXT record and would fail
registration.

Current procd_add_mdns_service checks only if the first passed arg is
empty but don't make any verification on the other args permittins
insertion of empty values in TXT record.

Example:

	procd_add_mdns "blah" \
				"tcp" "50" \
				"1" \
				"" \
				"3"

Produce:

{ "blah_50": { "service": "_blah._tcp.local", "port": 50, "txt": [ "1", "", "3" ] } }

The middle empty TXT record should never be included as it's empty.

This can happen with scripts that make fragile parsing and include
variables even if they are empty.

Prevent this and make the TXT record more solid by checking every
provided TXT record and include only the non-empty ones.

The fixed JSON is the following:

{ "blah_50": { "service": "_blah._tcp.local", "port": 50, "txt": [ "1", "3" ] } }

Fixes: b0d9dcf84d ("procd: update to latest git HEAD")
Reported-by: Paul Donald <newtwen@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15331
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 4b04304713)
2024-04-29 23:30:04 +02:00
..
ca-certificates ca-certificates: Update to version 20230311 2023-05-31 23:10:06 +02:00
fstools treewide: replace PKG_USE_MIPS16:=0 with PKG_BUILD_FLAGS:=no-mips16 2023-03-21 18:28:22 +01:00
fwtool fwtool: update to latest Git head 2019-11-14 22:53:31 +01:00
gpio-cdev/nu801 ath79: add Cisco Meraki MR18 2023-05-14 00:08:35 +02:00
iucode-tool treewide: Add extra CPE identifier 2023-09-27 22:37:13 +02:00
mtd treewide: add support for "lto" in PKG_BUILD_FLAGS 2023-03-21 18:28:22 +01:00
openwrt-keyring openwrt-keyring: add OpenWrt 22.03 GPG/usign keys 2022-03-25 14:28:00 +01:00
opkg treewide: replace AUTORELEASE with real PKG_RELEASE 2023-05-18 11:35:29 +02:00
procd procd: make mDNS TXT record parsing more solid 2024-04-29 23:30:04 +02:00
refpolicy Revert "refpolicy: add variant that builds modular policy" 2020-11-22 15:20:35 +00:00
rpcd rpcd: update to latest git HEAD 2023-08-11 12:53:33 +02:00
selinux-policy selinux-policy: update to 1.2.5 2023-05-31 23:10:06 +02:00
ubox treewide: replace AUTORELEASE with real PKG_RELEASE 2023-05-18 11:35:29 +02:00
ubus ubus: update to the latest version 2023-09-18 14:25:18 +02:00
ucert ucert: update to latest git HEAD 2020-05-24 17:01:36 +02:00
uci uci: update to git HEAD 2023-08-11 12:53:34 +02:00
urandom-seed urandom-seed: go back to seeding with shell script temporarily 2022-04-14 10:12:34 +02:00
urngd urngd: update to version 2023-11-01 2023-11-01 22:22:45 +01:00
usign treewide: add support for "lto" in PKG_BUILD_FLAGS 2023-03-21 18:28:22 +01:00
zram-swap treewide: replace AUTORELEASE with real PKG_RELEASE 2023-05-18 11:35:29 +02:00