[OpenWrt-Devel] UCI config bug or intent?

Dominik Taborsky dominik.taborsky at nic.cz
Wed Mar 25 06:28:14 EDT 2015


Hello,

a colleague of mine discovered a problem when using UCI: when there's a clash of identifiers, they mix together regardless of their type and the last type is set as the type of the identifier. Let me show an example:

root at turris:/etc/config# cat conflicting_config
config typeA 'sec1'
	list device 'dev1'
	list ignore 'dev2'

config typeA 'sec2'
	list device 'dev2'
	list ignore 'dev3'

config typeB 'sec1'
	list activate 'dev3'
	list activate 'dev4'
	option socket 'false'

root at turris:/etc/config# uci show conflicting_config
conflicting_config.sec1=typeB
conflicting_config.sec1.device=dev1
conflicting_config.sec1.ignore=dev2
conflicting_config.sec1.activate=dev3 dev4
conflicting_config.sec1.socket=false
conflicting_config.sec2=typeA
conflicting_config.sec2.device=dev2
conflicting_config.sec2.ignore=dev3


root at turris:/etc/config# uci show conflicting_config. at typeA[0]
conflicting_config.sec2=typeA
conflicting_config.sec2.device=dev2
conflicting_config.sec2.ignore=dev3


As you can see, UCI shows only one section named 'sec1' of typeB, while there are two sections of that name of different types. It mixes the options and lists together and does not report any problem with this. I would expect either to report a problem or consider these as different objects with the same name. A workaround for this is to use anonymous sections with an option with the name as the value, but I still think there at least should be a warning. I don't know how to report such a problem from within the UCI library though.

So what do you think?


Best regards,

Dominik Taborsky
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list